cancel
Showing results for 
Search instead for 
Did you mean: 

custom configuration for consumer role to a site

nareshvy
Champ in-the-making
Champ in-the-making

Hi , 

In my site all user require Collaborative role actually its consumer , so i added a configuration like this 

<permissionSet type="st:site" expose="selected">

<permissionGroup name="SiteManager" allowFullControl="true" expose="true" />

<permissionGroup name="SiteCollaborator" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" />
</permissionGroup>

<permissionGroup name="SiteContributor" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" />
</permissionGroup>

<permissionGroup name="SiteConsumer" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" />
</permissionGroup>

<permissionGroup name="SiteCommentator" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Consumer" type="cm:cmobject" />
<includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
</permissionGroup>

</permissionSet>

in  alfresco-community\tomcat\shared\classes\alfresco\extension\sitePermissionDefinitions.xml

but its still access denied for some operations.

or if there is any other way, please let me know with sample codes

Thank you

23 REPLIES 23

nareshvy
Champ in-the-making
Champ in-the-making

I creating user in this method

String urlString = "http://127.0.0.1:8090/alfresco/service/api/people?alf_ticket="
+ authTicket;
System.out.println("The addUser url:::" + urlString);
HttpClient client = new HttpClient();

PostMethod mPost = new PostMethod(urlString);
UserDetails objUserDetails = new UserDetails();
objUserDetails.setUserName(userdetailobj.getUserName());
objUserDetails.setPassword(userdetailobj.getPassword());
objUserDetails.setFirstName(userdetailobj.getFirstName());
objUserDetails.setLastName(userdetailobj.getLastName());
objUserDetails.setEmail(userdetailobj.getEmail());

//groups[0]="CBGroup"; 
objUserDetails.setGroups(group);
objUserDetails.setQuota(quota);

StringRequestEntity requestEntity = new StringRequestEntity(
getJSONString(objUserDetails), "application/json", "UTF-8");
mPost.setRequestEntity(requestEntity);
int statusCode1 = client.executeMethod(mPost);

here, trying to add this user into  CBGroup and how to add CBGroup to CBSite

kaynezhang
World-Class Innovator
World-Class Innovator

About webscript api ,please visit http://localhost:8080/alfresco/s/index/package/org/alfresco/repository/site/membership  and login with admin accout. how to add member to site 

nareshvy
Champ in-the-making
Champ in-the-making

thank you keyne,

String apiurl1 = "http://127.0.0.1:8090/alfresco/s/sites/"+siteName+"/memberships";
PostMethod post1 = new PostMethod(apiurl1);
JSONObject body1 = new JSONObject();
body1.put("shortName", groupName);
body1.put("displayName", groupName);
body1.put("displayName", groupName);
body1.put("site","site_"+siteName);

post1.setDoAuthentication(true);
post1.setRequestHeader("Content-Type", "application/json");
post1.setRequestEntity(new StringRequestEntity(body1.toString(),"application/json", "UTF-8"));
int status1 = client.executeMethod(post1);

getting error

 has responded with a status of 404 - Not Found

 Script url /sites/TESTDAM/memberships does not map to a Web Script

nareshvy
Champ in-the-making
Champ in-the-making

Hi Kayne, I Succes fully added user to group ...

Now I need to know How Groups are adding to site

Thank you