cancel
Showing results for 
Search instead for 
Did you mean: 

Invite user to space by webscript

sanket
Champ on-the-rise
Champ on-the-rise
Hi,
    Is there any webscript available which invites a user/group to a space ?

The webscript "Invite" is for inviting users to a site. As it is asking for parameters like siteShortName and inviteeSiteRole.

I am using Alfresco3.2r2.

Thanks in advance,
Sanket.
4 REPLIES 4

sanket
Champ on-the-rise
Champ on-the-rise
Well, I didn't find any direct webscript available for inviting users to a space.
I created my own and gave permission to the required user/group as follows.

String lStrSpaceUserName = request.getParameter("spaceUserName");
String lStrSpaceNodeRef = request.getParameter("spaceNodeRef");

String userName = getAuthorityService().getName(AuthorityType.USER, lStrSpaceUserName);
if(personService.personExists(userName)){
nodeRefOfPermissiveSpace = new NodeRef(Repository.getStoreRef(),lStrSpaceNodeRef);
Set set = getPermissionService().getPermissions(nodeRefOfPermissiveSpace);
Iterator iter = set.iterator();
while(iter.hasNext()){
System.out.println("******PErmissions*****:"+iter.next());
}
getPermissionService().setInheritParentPermissions(nodeRefOfPermissiveSpace, true);
getPermissionService().setPermission(nodeRefOfPermissiveSpace,userName ,PermissionService.COORDINATOR, true);
}
/*in this way, I gave the Coordinator role to the userName*/

Hope, it helps some of you guise.
Thanks,
Sanket.

msj4u
Champ in-the-making
Champ in-the-making
how do i invite a user group to space using webservices ?

kaynezhang
World-Class Innovator
World-Class Innovator
I'm afraid invitation service dose not expose webservice api,you can use webscript api.

msj4u
Champ in-the-making
Champ in-the-making
modified the code wrote and exposed the service