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.
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);