<?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 Function removePermission javascript in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291520#M244650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to change permissions on all my nodes using a script. The setPermission function is working good like this : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node.setPermission("permission", "GROUP_groupname");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But i need to remove all the old permissions on all the nodes too, so before setting new permissions, i try to erase all the old ones thank to removePermission, without user or group parameter, as explained in the documentation : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node.removePermission("permission");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it's not working. I used another method which is working good :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var permissions = ["Collaborator", "Contributor", "Consumer", "Editor", "Coordinator", "Read"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var groups = ["GROUP_groupe1", "GROUP_groupe2", "GROUP_groupe3", "GROUP_groupe4", "GROUP_groupe5"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(var z= 0; z &amp;lt; permissions.length; z++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(var w= 0; w &amp;lt; groups.length; w++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node.removePermission(permissions[z],groups[w]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But i need to understand. I think i miss understood this function. For me, using removePermission without precising a group or user, erase ALL the permission selected for all the users or groups in the selected node. Am I right ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does someone can explain to me please ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2015 10:25:09 GMT</pubDate>
    <dc:creator>antho_c</dc:creator>
    <dc:date>2015-07-17T10:25:09Z</dc:date>
    <item>
      <title>Function removePermission javascript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291520#M244650</link>
      <description>Hello,I need to change permissions on all my nodes using a script. The setPermission function is working good like this : &amp;lt;blockcode&amp;gt;node.setPermission("permission", "GROUP_groupname");&amp;lt;/blockcode&amp;gt;But i need to remove all the old permissions on all the nodes too, so before setting new pe</description>
      <pubDate>Fri, 17 Jul 2015 10:25:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291520#M244650</guid>
      <dc:creator>antho_c</dc:creator>
      <dc:date>2015-07-17T10:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function removePermission javascript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291521#M244651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi! did you find a solution for this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 20:44:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291521#M244651</guid>
      <dc:creator>acervantes2018</dc:creator>
      <dc:date>2018-03-14T20:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function removePermission javascript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291522#M244652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not tested it myself, but reading the documentation, I noticed a small detail, that can be the reason it is not working the way you want it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.alfresco.com/5.2/references/API-JS-removePermission.html" title="https://docs.alfresco.com/5.2/references/API-JS-removePermission.html" rel="nofollow noopener noreferrer"&gt;removePermission | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first variation:&lt;/P&gt;&lt;P&gt;removePermission(permission)&lt;BR /&gt;removePermission(permission) removes a permission for &lt;STRONG&gt;all users&lt;/STRONG&gt; from the node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second one:&lt;/P&gt;&lt;P&gt;removePermission(permission, authority)&lt;BR /&gt;removePermission(permission, authority) removes a permission for the specified authority (for example, &lt;STRONG&gt;a user name or group&lt;/STRONG&gt;) from the node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, it seems the first one is intended to be used with users only, and the samples you showed are all groups.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 01:20:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/function-removepermission-javascript/m-p/291522#M244652</guid>
      <dc:creator>douglascrp</dc:creator>
      <dc:date>2018-03-15T01:20:17Z</dc:date>
    </item>
  </channel>
</rss>

