Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
This wiki page explains how to create a custom Role within Alfresco for use in Alfresco Share.
A note of caution. If you add custom roles after you create sites those sites will break. While there may be a way to get around that the instructions in this guide assume this is a clean install with no sites created.
There are three steps to creating and using a custom Role within Alfresco Share:
In <shared>classes/alfresco/extension
Copy the sitePermissionDefinitions.xml file from the alfresco-repository.jar/alfresco/models to <shared>classes/alfresco/extension
Notice the following file should differ from your default file. We have added
<permissionGroup name='SiteCustomManager' allowFullControl='false' expose='true'>
<includePermissionGroup permissionGroup='Collaborator' type='cm:cmobject' />
</permissionGroup>
as our custom Role. Basically this is a new type of Collaborator we are calling Manager. However, Share already has a Site Manager Role, so we are going to call this Custom Manager just for this tutorial.
Your file should look like the following when done editing:
<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='SiteCustomManager' allowFullControl='false' expose='true'>
<includePermissionGroup permissionGroup='Collaborator' 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>
This file controls what text is shown for the Document Library Module Permissions functions.
\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\modules\documentlibrary\permissions.get[locale].properties
You will need to add two new properties to the file:
group.SiteCustomManager=Custom Managers
role.SiteCustomManager=Custom Managers privileges
NOTE: Make sure you edit the properties file as appropriate for your locale, e.g. permissions.get_en.properties
When done your file should look like the following:
## Titles
title.single=Manage Permissions for {0}
title.multi=Manage Permissions for {0} items
header.manage=Groups and Privileges
## Labels
label.reset-all=Use Defaults
label.have=have
label.mangerdefaults=Note: Site Managers always have full privileges.
## Messages
message.permissions.success=Permissions on {0} items updated successfully
message.permissions.failure=Could not update permissions
## Groups
group.SiteConsumer=Consumers
group.SiteCollaborator=Collaborators
group.SiteContributor=Contributors
group.SiteManager=Site Managers
group.EVERYONE=All Other Users
## Roles
role.None=No privileges
role.SiteManager=Manager privileges
role.SiteContributor=Contributor privileges
role.SiteCollaborator=Collaborator privileges
role.SiteConsumer=Consumer privileges
## Added by MJL 10/12/2009
group.SiteCustomManager=Custom Managers
role.SiteCustomManager=Custom Managers privileges
You will also need to update the following file:
\tomcat\webapps\share\WEB-INF\classes\alfresco\messages\slingshot_[locale].properties
To add the following property:
role.SiteCustomManager=Custom Managers privileges
This property is used when modifying the privileges of site members after they have been invited.
When you invite a user to a Share Site you will need to give that user a Role. This is controlled through the Invite Web Script which is part of the Site Member Component in any given Shar Site. Open the following file, we will need to add two properties:
\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\invite\invitationlist.get[locale].properties
You will need to add two new properties to the file:
group.SiteCustomManager=Custom Managers
role.SiteCustomManager=Custom Managers
Notice in your file there are no entries for any of the Roles. Not sure where the Web Script is picking up the other Roles, but we can easily add these lines to the property file to have the UI show our new Role. Your file should look like the following:
## messages
message.inviteresult={0} invites sent out, {1} failures
## labels
invitationlist.title=Invite Users
invitationlist.invite=Invite
invitationlist.selectallroles=Set All Roles to
invitationlist.selectrole=Select Role
invitationlist.empty-list=Users added here will be invited
invitationlist.or=or
invitationlist.back-to=back to Site Members
## role labels
role=Role
## Added by MJL 10/12/2009
group.SiteCustomManager=Managers
role.SiteCustomManager=Manager privileges
There are three places where we can set a users permissions.
The following screen shots show this working.
As mentioned at the top of this article, creating a new custom Share role breaks some functionality of existing sites. (JIRA related to this issue is https://issues.alfresco.com/jira/browse/MNT-2456)
In order to fix this issue, you need to create a script to manually add a site role group for all existing sites.
e.g. GROUP_site_<my site>_<my custom role>
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.