Add new permission for existing site groups – Alfresco Share

Sometimes, the default site permissions would not be enough for particular use case. Take for example, a user is added as a collaborator to a site. The user can add documents, but cannot delete any. Now say we want to add delete permission for this user. How do we go about doing that quickly?

 

Requisites
1. Alfresco 5.x
2. Notepad++ or text editor
3. Alfresco Share.war file
 Steps
Assuming Alfresco is installed on C:\Alfresco on a windows machine, goto
1.)  Extract the ‘sitePermissionDefinitions.xml’ out of ‘alfresco-repository-5.0.1.jar’ and place it at ‘./tomcat/shared/classes/alfresco/extension/’
2.)  Modify the permission for the ‘SiteCollaborator’ to your liking, e.g. from
<permissionGroup name="SiteCollaborator" allowFullControl="false" expose="true">
   <includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject"/>
</permissionGroup>

to

<permissionGroup name="SiteCollaborator" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" />
<includePermissionGroup permissionGroup="Delete" type="sys:base"/>
</permissionGroup>
3.)  Override the bean which is looking for the custom permissions’ model file during bootstrap, otherwise the default ‘permissions’ model which is shipped in ‘alfresco-repository-5.0.1.jar’ will be bootstrapped.
      a.)  Unzip ‘alfresco-repository-5.0.1.jar’  to temporary folder and copy the ‘site-services-context.xml’  to ‘./tomcat/shared/classes/alfresco/extension/’
      b.)  Modify the bean from:
<!-- Bootstrap the permission model -->
<bean id="siteService_permissionBootstrap"  parent="permissionModelBootstrap">

   <property name="model" value="alfresco/model/sitePermissionDefinitions.xml"/>

</bean>
to
<!-- Bootstrap the permission model from the extension directory -->
<bean id="siteService_permissionBootstrap" parent="permissionModelBootstrap">

<property name="model" value="alfresco/extension/sitePermissionDefinitions.xml"/>

</bean>

4.)   Restart your Alfresco instance and verify that the new permissions have been granted to the collaborator group users.

Advertisements

Leave a Reply

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