cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Home Space of user using webscript

arpit_gupta
Champ in-the-making
Champ in-the-making
Hi,

I have created a new user using web script providing properties of user as json object.

Right now when i create the user, alfresco creates a folder in the User_Home folder with name same as the username and set this folder as the home space of the user.

But i do not want that. I need to set homespace of the newly created user to a predefined folder.

I didn't find any user property related to home space Hence i am unable to set it using web script.

Please Help me out.

Thanks,
Arpit
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
Old post but answer could be useful to other users.

There is a API in permissionservice for that.

setPermission(homeSpaceRef,userName,permissionService.getAllPermission(), true);
You can use this api to set the permission of the created user on the homespace.

you also need to make the user owner of that space by ownerservice's API
setOwner(homeSpaceRef, this.userName);

silenr0c
Champ in-the-making
Champ in-the-making
I am trying to do the same and found this solution:
http://anythingalfresco.wordpress.com/2011/08/04/adding-permissions-using-alfresco-javascript-api/

following are the user roles and permissions table.
http://www.alfresco.com/help/webclient/concepts/cuh-user-roles-permissions.html

Cheers,
- silenr0c -