<?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: Modify node users permissisons programatically in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40985#M17183</link>
    <description>&lt;P&gt;Pretty easy, simply use &lt;STRONG&gt;nodeApiService.updateNode &lt;/STRONG&gt;with update body like this&lt;/P&gt;&lt;PRE&gt;const update = {
 
      permissions: {
        isInheritanceEnabled: false,
        locallySet: [
          {
            authorityId: 'user1',
            name: 'Collaborator',
            accessStatus: 'ALLOWED',
          },
          {
            authorityId: 'GROUP_group1',
            name: 'Read',
            accessStatus: 'ALLOWED',
          },
        ],
      },
    };

this.nodeApiService.updateNode(nodeId, update).subscribe(
      (updatedNode) =&amp;gt; (console.log("done")),
      (err) =&amp;gt; {
        console.log(`Error Setting node permissions ${err}`);
        this.onFailed(`Error Updating Permissions.`);
      }     
    );&lt;/PRE&gt;</description>
    <pubDate>Mon, 31 Aug 2020 14:16:02 GMT</pubDate>
    <dc:creator>oviwonkenovi</dc:creator>
    <dc:date>2020-08-31T14:16:02Z</dc:date>
    <item>
      <title>Modify node users permissisons programatically</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40984#M17182</link>
      <description>&lt;P&gt;I'm working with ADF and I would like to change a Node permisions to disable heritage and set permisión to a especific group and user. In ADF there are various elements to allow the user to handle permisions. However I would like to make this programatically as i will set always same&amp;nbsp; permissions and y would like to make it automatically.&lt;/P&gt;&lt;P&gt;I have been taking a look to the &lt;A href="https://www.alfresco.com/abn/adf/docs/content-services/services/node-permission.service/&amp;nbsp;" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;EM&gt;&lt;STRONG&gt;PermisionService&lt;/STRONG&gt;&lt;/EM&gt;&lt;/A&gt;. But i haven't found a way to remove all permisions and se just the ones I like. Does anybody has or knows where i can find a sample code for setting programatically the permissions of a node.&lt;/P&gt;&lt;P&gt;thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 13:12:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40984#M17182</guid>
      <dc:creator>oviwonkenovi</dc:creator>
      <dc:date>2020-07-09T13:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Modify node users permissisons programatically</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40985#M17183</link>
      <description>&lt;P&gt;Pretty easy, simply use &lt;STRONG&gt;nodeApiService.updateNode &lt;/STRONG&gt;with update body like this&lt;/P&gt;&lt;PRE&gt;const update = {
 
      permissions: {
        isInheritanceEnabled: false,
        locallySet: [
          {
            authorityId: 'user1',
            name: 'Collaborator',
            accessStatus: 'ALLOWED',
          },
          {
            authorityId: 'GROUP_group1',
            name: 'Read',
            accessStatus: 'ALLOWED',
          },
        ],
      },
    };

this.nodeApiService.updateNode(nodeId, update).subscribe(
      (updatedNode) =&amp;gt; (console.log("done")),
      (err) =&amp;gt; {
        console.log(`Error Setting node permissions ${err}`);
        this.onFailed(`Error Updating Permissions.`);
      }     
    );&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2020 14:16:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40985#M17183</guid>
      <dc:creator>oviwonkenovi</dc:creator>
      <dc:date>2020-08-31T14:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Modify node users permissisons programatically</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40986#M17184</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/82342"&gt;@oviwonkenovi&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for updating us with how you solved your issue. It's really helpful to other users when someone does this.&lt;/P&gt;
&lt;P&gt;So, thanks again.&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;

&lt;P&gt;ps - I'll also mark this as Solution Accepted.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 16:19:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/modify-node-users-permissisons-programatically/m-p/40986#M17184</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-09-10T16:19:52Z</dc:date>
    </item>
  </channel>
</rss>

