cancel
Showing results for 
Search instead for 
Did you mean: 

Changing role of a user/group

sgomez
Champ in-the-making
Champ in-the-making
Hello,

I am a bit confused on how to change the role of a user or group through webscripts.  I am using roles as described in http://wiki.alfresco.com/wiki/Permissions_and_Roles_Configuration#What_is_a_role.3F :

"If you are assigning roles to people and groups you are using roles as a convenient name for a bundle of permissions and other roles. This is what we do in the UI."

From my understanding, there are already predefined roles Alfresco, like Administrator, Contributor, and Consumer.  What I am trying to achieve is change a user "bob" from an Adminstrator role to a Consumer role.  Alternatively, I could assign the Consumer role to a group and put "bob" into that group.  Is there a way to do that through the Javascript API?

I looked through http://wiki.alfresco.com/wiki/3.1_JavaScript_API and a few posts through the forums, but found nothing.  I would greatly appreciate any help.

Thanks,
sgomez
1 REPLY 1

tarl
Champ in-the-making
Champ in-the-making
Hello!
I'm not sure of what you really need but this may help:
space.setPermission("Permission", Bob );      
space.save();
You ll probably have some trouble with the inherited permissions. You can use this to remove it:
space.setInheritsPermissions(false); 
  space.save();
I hope this will help!