cancel
Showing results for 
Search instead for 
Did you mean: 

Add or Modify roles in Alfresco Community 5

anurags
Champ in-the-making
Champ in-the-making
Hello Everyone,

I am using Alfresco 5 community edition and want to add more roles. Please explain me how can I add more roles or modify exixting roles (ie contributer, consumer etc).

Regards,
Anurag
14 REPLIES 14

fat_kid
Champ in-the-making
Champ in-the-making
I'm wanting to do the same thing, have you had any success with this?

borisstankov
Champ in-the-making
Champ in-the-making
Hi there,

May be those topics can help you:
http://wiki.alfresco.com/wiki/Permissions_and_Roles_Configuration#Default_Permissions
https://wiki.alfresco.com/wiki/Custom_Permissions_in_Share

Also how customer you wnat to be those roles?
If you define your user groups more accurate, you may use the default groups, because in the new alfreso (5.0.x) they are 2times more then the previous version. Current state of the permissions you cna find here: http://docs.alfresco.com/community/references/permissions_share_components.html

Regards!

fat_kid
Champ in-the-making
Champ in-the-making
Hi Boris,
Thanks for the info, I'd read through those already and this one seems to be the most relevant:
<a href="https://wiki.alfresco.com/wiki/Custom_Permissions_in_Share">https://wiki.alfresco.com/wiki/Custom_Permissions_in_Share</a>
What I'm trying to achieve is a Collaborator permission that applies to content, but not the folder itself.
I.e. the user can create and edit files and folders, but cannot edit the parent folder properties (to rename it for example).
To give a comparison to Windows folder permissions, it's equivalent to Applies to "Subfolders and files only" rather than "This folder, subfolders and files".

In my v5.0d install I wasn't able to find sitePermissionDefinitions.xml anywhere. The wiki post talks about alfresco-repository.jar but I couldn't locate that either when I searched for the filename.
I've just figured out right now that alfresco-repository.jar is called alfresco-repository-5.0.d.jar in my version and located in:
<blockquote>tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.0.d.jar</blockquote>
I've unzipped this and found the sitePermissionDefinitions.xml in <blockquote>alfresco/model/sitePermissionDefinitions.xml</blockquote> so I'll try and follow the instructions in the wiki and see if I get stuck anywhere else.

Thanks,
Richard

borisstankov
Champ in-the-making
Champ in-the-making
HI,

No problem!
Try to edit the xml file directly in the .jar file - just to be sure that you are on the safe side and the alfresco will be able to read the file after you put it back in the right place with the new xml.

Also on the other hand, you can try this.
1. Setup a group of user, for exmaple "All_Users" - the main one where all users are located and they will be only consumers for the main folder. From Manage Permission click on the "Inherite permissions" button and then add this group "All_users" as consumers.
2. When you create a new subfodler - go to Manage Permissions again and click on the "Inherite permissions" which will disable this subfolder from all users. Add a smaller group of users with Collaborator rightes and see the results.
I thinks this way will be more easier instead of touching the code of the program.


Regards!

fat_kid
Champ in-the-making
Champ in-the-making
Awesome, thanks for the tip about editing the .jar file directly. This worked.

Thanks for your thoughts about group permissions, I am already doing this but the subfolder that has collaborator the users still can rename. This is where I need the permission structure change.
I'll add another post with the steps that I needed to take to make it work, in case anyone else is having this issue.
Basically with your pointer about editing the file within the .jar and the two other files (permissions.get.properties and slingshot.properties) mentioned in the Wiki artile and one more file I found (common.properties) I was able to make it work.

borisstankov
Champ in-the-making
Champ in-the-making
Hi man,

I'm glad that I could help you do your configurations changes in the role permission.
I checked your steps, which are very detailed. It will help alot of ppl when they check the forum Smiley Happy

Cheers, mate!

how to restrict the delete option(for his own document) for the contributor role.

fat_kid
Champ in-the-making
Champ in-the-making
Thanks to Boris, this is the process that worked for me to add Collaborator for subfiles and folders only, not this folder.
I called my role "Content Collaborator".

Find the alfresco-repository.jar file for your version. In v5.0d it is
<blockquote>tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.0.d.jar</blockquote>
Add your new role. Here's my Content Collaborator definition
<blockcode>
      <permissionGroup name="ContentCollaborator" allowFullControl="false" expose="true">
         <includePermissionGroup permissionGroup="Consumer" type="cm:cmobject" />
         <includePermissionGroup permissionGroup="WriteContent" type="sys:base" />
         <includePermissionGroup permissionGroup="AddChildren" type="sys:base"/>
         <includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
      </permissionGroup>
</blockcode>
Make sure you save the changes back into the .jar file.

Next update permissions.get.properties
<blockquote>tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/documentlibrary/permissions.get.properties</blockquote>
Add your role
<blockcode>
group.SiteContentCollaborator=Content Collaborators
role.SiteContentCollaborator=ContentCollaborator privileges
</blockcode>
Next update the slingshot.properties (to give nice name in invite users)
<blockquote>tomcat/webapps/share/WEB-INF/classes/alfresco/messages/slingshot.properties</blockquote>
Add your role
<blockcode>
role.SiteContentCollaborator=Content Collaborator
</blockcode>
Lastly update common.properties (to give nice name in document library edit properties)
<blockquote>tomcat/webapps/share/WEB-INF/classes/alfresco/messages/common.properties</blockquote>
add your role
<blockcode>
roles.sitecontentcollaborator=Site Content Collaborator
</blockcode>
Restart your alfresco service.

That's it.
Enjoy!

aniruddha
Champ on-the-rise
Champ on-the-rise

how to restrict the delete option(for his own document) for the contributor role.