Hide ‘Manage-permissions’ link in sites – Alfresco Share

I have a site and i want to restrict all users from making any changes to the sites permissions. Is there a quick and easy way to do that in Alfresco One 5.0? Lets look at sites and permissions and how we can apply a quick fix.

A user can create a site in Alfresco. The creator is also the owner of a site. They can change the site permissions, make it private or public, invite users to join the sites etc. Site users could be Collaborators, Contributors or even Managers, depending on how they were added to the site. Sometimes the use case may be that no users of the sites should be able to manage the permissions of a site or its contents.

While there are multiple options available to restrict permissions to a user, the following solution is a quick and dirty option. Think of this more of a short term solution while you are working on a proper long term solution.

Advertisements

Requisites

  1. Alfresco 5.0
  2. NotePad++ or any text editor
  3. Knowledge of Share.war files and folder structure

Steps

Assuming your Alfresco root folder is C:\Alfresco, and you have a running instance of Alfresco, goto C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco and open “share-documentlibrary-config.xml” file in a text editor.

Search for ” document-manage-granular-permissions ” within this document and you would see the following section towards the middle of the document.

<!-- Manage permissions (granular permissions) -->
<action id="document-manage-granular-permissions" type="link" icon="document-manage-permissions" label="actions.document.manage-permissions">
     <param name="href">{managePermissionsUrl}</param>
     <permissions>
       <permission allow="true">ChangePermissions</permission>
     </permissions>
     <evaluator negate="true">
        evaluator.doclib.action.siteBased
     </evaluator>
     <evaluator negate="true">
        evaluator.doclib.action.isWorkingCopy 
     </evaluator>
</action>

Now edit this section and add the highlighted text.

<!-- Manage permissions (granular permissions) -->
<action id="document-manage-granular-permissions" type="link" icon="document-manage-permissions" label="actions.document.manage-permissions">
     <param name="href">{managePermissionsUrl}</param>
     <permissions>
        <permission allow="true">ChangePermissions</permission>
     </permissions>
     <evaluator negate="true">
          evaluator.doclib.action.siteBased 
     </evaluator>
     <evaluator negate="true">
          evaluator.doclib.action.isWorkingCopy
     </evaluator>
     <evaluator negate="false">
          evaluator.doclib.action.isSiteManager
     </evaluator>
     <evaluator negate="false">
          evaluator.doclib.action.isSiteCollaborator
     </evaluator>
     <evaluator negate="false">
          evaluator.doclib.action.isSiteContributor
     </evaluator>
     <evaluator negate="false">
          evaluator.doclib.action.isSiteConsumer
     </evaluator>
</action>

Similarly search for ” document-manage-repo-permissions ” section and add the following highlighted text as shown below

<!-- Manage permissions (repository roles) --> 
<action id="document-manage-repo-permissions" type="link" icon="document-manage-permissions" label="actions.document.manage-permissions">
      <param name="href">{managePermissionsUrl}</param>
      <permissions>
         <permission allow="true">ChangePermissions</permission>
      </permissions>
      <evaluator negate="true">
          evaluator.doclib.action.siteBased
      </evaluator>
      <evaluator negate="true">
           evaluator.doclib.action.isWorkingCopy
      </evaluator>
      <evaluator negate="false">
           evaluator.doclib.action.isSiteManager
      </evaluator>
      <evaluator negate="false">
           evaluator.doclib.action.isSiteCollaborator
      </evaluator>
      <evaluator negate="false">
           evaluator.doclib.action.isSiteContributor
      </evaluator>
      <evaluator negate="false">
          evaluator.doclib.action.isSiteConsumer
      </evaluator>
</action> 

Save the changes and restart Alfresco server. Go to a site and drill down to any folder or document on that site.

hide manage permissions

 

When you look at the Folder Actions view you would not see “Manage Permissions” link for any document or folder.

 

Advertisements

Leave a Reply

Your email address will not be published. Required fields are marked *