cancel
Showing results for 
Search instead for 
Did you mean: 

Custom site roles/permissions

strecki
Champ in-the-making
Champ in-the-making
I want to create new roles in Alfresco share (or rename the existing ones). As a starting point I used the following:

http://wiki.alfresco.com/wiki/Custom_Permissions_in_Share
http://keytocontent.blogspot.de/2011/04/alfresco-share-permissionsroles-part-ii.html

1.

Is it possible to rename the existing roles (including the SiteManager), that would make things much easier for me. But I can't find the place, where the names are stored and read from.

2.

If that fails, is it possible to delete or hide the existing roles, so that only the new ones are shown?

3.

Additionaly, the SiteManager/ Manager role can't be reproduced by just using:
<permissionGroup name="CustomSiteManager" allowFullControl="true" expose="true" />
The new role doesn't have all permissions.


Thanks in advance.
3 REPLIES 3

erikwinlof
Confirmed Champ
Confirmed Champ
Hi,

Yes its possible to rename the roles. Share has 2 general msg property files called slingshot.properties & common.properties files that contain all global msg keys that could be used by multiple components. However individual components (aka webscripts) can also specify msg keys in the some-component.get.properties. Therefor you will need to override the msg keys in slingshot.properties AND the .get.properties files for the components that have defined their own msg keys for the roles.

1. Start by creating a new spring mvc context file that will make sure an additional .properties file is loaded that will override shares msg keys.

/alfresco/web-extension/custom-slingshot-acme-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans-2.0.dtd'>
<beans>
   <bean id="cloud.custom.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
            <value>alfresco.messages.acme</value>
         </list>
      </property>
   </bean>
</beans>

2. Then create the actual .properties who's keys will override the ones in slingshot.properties:

/alfresco/messages/acme.properties
## Rename Roles
role.SiteManager=Acme Manager
role.SiteCollaborator=Acme Collaborator
role.SiteContributor=Acme Contributor
role.SiteConsumer=Acme Consumer

3. When it comes to overriding the msg keys for a component a lot of improvements have been done in Alfresco 4.0 in which you (rather than overriding the entire file) can override only some of the msg keys (and also add new ones of course). To see how its done in Alfresco 4.0 see this blog post: http://blogs.alfresco.com/wp/ddraper/2011/08/03/customizing-alfresco-share-i18n-properties/

In previous versions of Alfresco you must however override each component's .get.properties file. The file is overriden by placing another file with the same name inside the web-extension directory.

I.e. to override…
tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/document-details/document-metadata.get.properties
…copy the original to the following location and modify the keys as you see fit…
tomcat/shared/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/document-details/document-metadata.get.properties

To find which files to change use Surf Bug as described in the blog post I linked to above OR do a search in tomcat/webapps/share for the keys you want to change.

Cheers, Erik

I have two web-extension C:\Alfresco\tomcat\shared\classes\alfresco and in C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco In which folder should I us

strecki
Champ in-the-making
Champ in-the-making
Thank you very much, that helped me a lot.