<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set Permission through REST API in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54557#M20109</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is similar thread for what you are looking for, check out this link,&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="237090" __jive_macro_name="thread" _jive_internal="true" class="jive_macro_thread jive_macro link-titled" href="https://community.alfresco.com/thread/237090-set-file-permission-rest-api" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will be helpful to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2018 07:03:56 GMT</pubDate>
    <dc:creator>jayesh_prajapat</dc:creator>
    <dc:date>2018-05-22T07:03:56Z</dc:date>
    <item>
      <title>Set Permission through REST API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54556#M20108</link>
      <description>Dear friendsHow can I set permission by using update Node APICan I Do this directly&amp;nbsp;by HttpClient and HttpPost methods?PLEASE, can You give me some code example?Thank You</description>
      <pubDate>Tue, 22 May 2018 05:59:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54556#M20108</guid>
      <dc:creator>dadamia</dc:creator>
      <dc:date>2018-05-22T05:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set Permission through REST API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54557#M20109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is similar thread for what you are looking for, check out this link,&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="237090" __jive_macro_name="thread" _jive_internal="true" class="jive_macro_thread jive_macro link-titled" href="https://community.alfresco.com/thread/237090-set-file-permission-rest-api" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will be helpful to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2018 07:03:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54557#M20109</guid>
      <dc:creator>jayesh_prajapat</dc:creator>
      <dc:date>2018-05-22T07:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Permission through REST API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54558#M20110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;BR /&gt;&amp;lt;shameless plug&amp;gt;&lt;BR /&gt;I think you are looking for &lt;A href="https://github.com/fsckawk/alfresco-shell-tools/blob/master/bin/alfSetPermissions.sh" rel="nofollow noopener noreferrer"&gt;alfSetPermissions.sh&lt;/A&gt; from &lt;A href="https://github.com/fsckawk/alfresco-shell-tools" rel="nofollow noopener noreferrer"&gt;alfresco-shell-tools &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/shameless plug&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2018 12:20:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54558#M20110</guid>
      <dc:creator>fsck_awk</dc:creator>
      <dc:date>2018-05-22T12:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set Permission through REST API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54559#M20111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends&lt;/P&gt;&lt;P&gt;I solve this problem by&amp;nbsp;via&amp;nbsp;Put Method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NameValuePair nvp = new BasicNameValuePair("include", "premissions");&lt;BR /&gt; builder.setScheme("http").setHost("localhost").setPort(8080).setPath("/alfresco/api/-default-/public/alfresco/versions/1/nodes/" + nodeId).setParameters(nvp);&lt;BR /&gt; HttpClient httpClient = HttpClientBuilder.create().build();&lt;BR /&gt; HttpPut put = new HttpPut(builder.build());&lt;/P&gt;&lt;P&gt;String alfrescoUser = "admin";&lt;BR /&gt; String pass = "admin";&lt;BR /&gt; UsernamePasswordCredentials creds = new UsernamePasswordCredentials(alfrescoUser, pass);&lt;BR /&gt; List&amp;lt;PermissionElementRepresentation&amp;gt; userPermissions = new ArrayList&amp;lt;PermissionElementRepresentation&amp;gt;();&lt;BR /&gt; PermissionElementRepresentation newPermission = new PermissionElementRepresentation();&lt;BR /&gt; newPermission.setAuthorityId("dato");&lt;BR /&gt; newPermission.setName("Read");&lt;BR /&gt; newPermission.setAccessStatus(AccessStatusEnum.ALLOWED);&lt;BR /&gt; userPermissions.add(newPermission);&lt;BR /&gt; PermissionsBodyUpdate permission = new PermissionsBodyUpdate(false, userPermissions);&lt;BR /&gt; NodeBodyUpdate permissionRequest = new NodeBodyUpdate(permission);&lt;BR /&gt; Gson gson = new Gson();&lt;BR /&gt; String jsonInString = gson.toJson(permissionRequest);&lt;BR /&gt; StringEntity se;&lt;BR /&gt; se = new StringEntity(jsonInString);&lt;BR /&gt; put.setEntity(se);&lt;BR /&gt; put.setHeader("Accept", "application/json");&lt;BR /&gt; put.setHeader("Content-type", "application/json");&lt;BR /&gt; put.addHeader(new BasicScheme().authenticate(creds, put, null));&lt;BR /&gt; HttpResponse httpResponse = httpClient.execute(put);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2018 13:21:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/set-permission-through-rest-api/m-p/54559#M20111</guid>
      <dc:creator>dadamia</dc:creator>
      <dc:date>2018-05-22T13:21:55Z</dc:date>
    </item>
  </channel>
</rss>

