cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent folder creation for specific role?

nenad982
Champ on-the-rise
Champ on-the-rise
Hi all,

I would like to disable persons which has specific role (are members of some group) to create folders using Share UI or WebDAV.

Do you have suggestion what would be the most elegant and user-friendly way to do this?

Thanks
8 REPLIES 8

kaynezhang
World-Class Innovator
World-Class Innovator
You can  to extend alfresco  permission model and define a custom role which only have read permissions;
Follow url
 http://wiki.alfresco.com/wiki/Permissions_and_Roles_Configuration#Default_Permissions 
is a description about permission and role
and look to
http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fsecur-permi...
for how to extend permission

Hi kaynezhang,

thank you for your answer but I don't see how I can forbid creation of FOLDER (not content) for specific role??? There is specific permission group CreateChildren but it there is not CreateFolder or CreateContent. Maybe I didn't understand your suggestion very well so could you please explain me a little bit more what is your idea?

Thanks

nenad982
Champ on-the-rise
Champ on-the-rise
Does anyone maybe knows how to deal with this?

Thanks in advanced

kaynezhang
World-Class Innovator
World-Class Innovator
Do you want these users to create content in this folder?

If yes ,you can create a new role that only have permissions such as _ReadProperties、_ReadChildren etc.. but don't have permissions such as _DeleteChildren、_CreateChildren、_DeleteNode。 And assign the new role to your users on that space.
If no,  also don't give your new role AddChildren permission.

kaynezhang
World-Class Innovator
World-Class Innovator
I'm very sorry it is  my mistake ,only forbiding creation of FOLDER not content for specific role is not realizable .Is it your requirement that forbiding creation of FOLDER not content content for specific role?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

crono40
Champ on-the-rise
Champ on-the-rise
Maybe you can do it with a script  applying a rule on your repository folder. This rule will execute a JS script when elements will be created in this folder.

In the script you have to test two things :

Firstly, if the document you'are creating is a folder ( if(document.isContainer()) )
And if your user is part of a group. For this, look the JS Api http://wiki.alfresco.com/wiki/4.0_JavaScript_Services_API and the function getAllUsers() whick give you all users of a group.
If tho previous conditions are gook, you will have to delete the folder : document.remove();

nenad982
Champ on-the-rise
Champ on-the-rise
Hi all,

just to update this post because I found solution. So requirement at the end was to disable Site Collaborators to create folders (just folders, not content). What I did is following:

- I override server site Java script controller for web scripts which will render Document Library toolbar, as also as controllers for Drag and Drop area and I added additional information to model - is current user Site Collaborator. With that information I will hide 'New Folder' button from toolbar as also as 'Create a folder' link from Drag and Drop area. So this is related to Share UI.
- I create bahavior and implemented 'NodeServicePolicies.BeforeCreateNodePolicy' policy for cm:folder type. And when it is triggered, I am checking is folder part of some site and does user has Site Collaborator role on the site. If has I will throw


net.sf.acegisecurity.AccessDeniedException.AccessDeniedException


exception so this will cover if collaborator tries to create folders using WebDAV client. This also give us server site security checking.

Thanks to all…

vanson
Champ on-the-rise
Champ on-the-rise

Hello,

Am having the same prolem canyou please share with me a detailed solution 

Will be grateful