In my previous article we checked out the permissions system in Alfresco. Sometimes, we may find ourselves in a situation where none of the default privileges match our needs and so, we need to create a new role with those set permissions. In this article I will show you how to create a new role with the desired privileges.
Steps to Create New Role
Step 1:
Create sitePermissionDefinitions.xml under following location in your Alfresco installation.
<ALF_Home>\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension
Step 2:
Copy site related entry from existing sitePermissionDefinitions.xml file from following location
<ALF_Home>\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\model
Step 3:
Add one more entry of “permission Group” in new sitePermissionDefinitions.xml file
It should look like this after adding entry
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE permissions > <permissions> <namespaces> <namespace uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/> <namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/> <namespace uri="http://www.alfresco.org/model/site/1.0" prefix="st"/> </namespaces> <permissionSet type="st:site" expose="selected"> <permissionGroup name="SiteManager" allowFullControl="true" expose="true" /> <permissionGroup name="SiteCollaborator" allowFullControl="false" expose="true"> <includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" /> </permissionGroup> <permissionGroup name="SiteNewRole" allowFullControl="false" expose="true"> <includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" /> </permissionGroup> <permissionGroup name="SiteContributor" allowFullControl="false" expose="true"> <includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" /> </permissionGroup> <permissionGroup name="SiteConsumer" allowFullControl="false" expose="true"> <includePermissionGroup permissionGroup="Consumer" type="cm:cmobject" /> </permissionGroup> </permissionSet> </permissions>
In this case we have added new role called “SiteNewRole”
Step 5:
Add entries related to new role in property files permissions.get_en.properties
<ALF_HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\modules\documentlibrary\
group.SiteNewRole =New Collaboratorrole.SiteNewRole =New Collaborator Role
Step 6:
Add following entry in slingshot_en.properties
<ALF_HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\messages
role.SiteNewRole=New Role privileges
NOTE: Ideally we should not change out of box files for customization best practice is to override the given component using extension module
Further Reading:
http://docs.alfresco.com/4.0/tasks/rm-roles-add.html
Looking for quality Alfresco Web Hosting? Look no further than Arvixe Web Hosting!
Hi..thank you for the post. My requirement is to add a new role with consumer permissions along with permission to add comments and reply to discussions.Needed help on this.
Thanks in advance