<?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 Script to remove control of a document from its creator? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/script-to-remove-control-of-a-document-from-its-creator/m-p/102548#M71384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What I am trying to do is configure a space into which users can place documents but, once placed, the document ceases to be under the user's control (ie, is no longer editable or deletable by the owner).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried the following, which comes very close:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (document.isDocument) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;document.removePermission("FullControl","ROLE_OWNER");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;document.setOwner("admin");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;props = new Array(1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;props["cm:lockType"] = "READ_ONLY_LOCK";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;props["cm:lockOwner"] = "admin";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;document.addAspect("cm:lockable", props);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 'removePermission' line appears to have no effect.&amp;nbsp; The creator of the document can still unlock (and hence edit, delete) the document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;document.removePermission("Unlock","ROLE_OWNER");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I suspect that I need something closer to &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;document.removePermission("Unlock","ROLE_CREATOR");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to do this that does not require changing &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;model/permissionDefinitions.xml?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the script has been run, the following is shown in the node browser:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:lockOwner == admin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;wner == admin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:creator == alfuser1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:description&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:lockType = READ_ONLY_LOCK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:author == &amp;lt;empty&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:modifier == alfuser1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aspects&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;wnable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:auditable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:titled&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:lockable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/system/1.0}referenceable" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/system/1.0}referenceable&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;cm:author&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 May 2007 00:31:24 GMT</pubDate>
    <dc:creator>pdoggett</dc:creator>
    <dc:date>2007-05-15T00:31:24Z</dc:date>
    <item>
      <title>Script to remove control of a document from its creator?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-remove-control-of-a-document-from-its-creator/m-p/102548#M71384</link>
      <description>What I am trying to do is configure a space into which users can place documents but, once placed, the document ceases to be under the user's control (ie, is no longer editable or deletable by the owner).I have tried the following, which comes very close:if (document.isDocument) {document.removePerm</description>
      <pubDate>Tue, 15 May 2007 00:31:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-remove-control-of-a-document-from-its-creator/m-p/102548#M71384</guid>
      <dc:creator>pdoggett</dc:creator>
      <dc:date>2007-05-15T00:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script to remove control of a document from its creator?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-remove-control-of-a-document-from-its-creator/m-p/102549#M71385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Phillip, first of all excuse my poor english.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have created a script with the next code executed by a rule:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;document.setInheritsPermissions(false);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;It is mandatory to comment in permissionDefinitions.xml file (at the end of file)the next line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;!– For now, owners can always see, find and manipulate their stuff –&amp;gt;&lt;BR /&gt;&amp;lt;!– &amp;lt;globalPermission permission="FullControl" authority="ROLE_OWNER"/&amp;gt; –&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;then reboot Alfresco.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Warning: if you don't comment this line, the owner's document will always have all their permissions intact.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;and it works perfectly !!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now nobody except admin has permission about this document, so that any user with Space Contributor permission can add a document into a Space and then he no longer has permits on his own document, no read, no write, … nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to give permissions (e.g.) to reviewer's group to this document you could add the next line to the javascript code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;document.setPermissions("Coordinator", "GROUP_REVIEWERS");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Important: this code line is to be put before the other code line (setInerithsPermissions), because once has been executed the user can no longer assign permissions.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;I helped me a lot these links:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.alfresco.com/en/viewtopic.php?f=12&amp;amp;t=6775&amp;amp;hilit=role+owner" rel="nofollow noopener noreferrer"&gt;http://forums.alfresco.com/en/viewtopic.php?f=12&amp;amp;t=6775&amp;amp;hilit=role+owner&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.alfresco.com/en/viewtopic.php?f=5&amp;amp;t=3498&amp;amp;hilit=owner+remove+control" rel="nofollow noopener noreferrer"&gt;http://forums.alfresco.com/en/viewtopic.php?f=5&amp;amp;t=3498&amp;amp;hilit=owner+remove+control&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this can help you or someone else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Javier&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 14:31:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-remove-control-of-a-document-from-its-creator/m-p/102549#M71385</guid>
      <dc:creator>ljjuarez</dc:creator>
      <dc:date>2008-10-08T14:31:51Z</dc:date>
    </item>
  </channel>
</rss>

