cancel
Showing results for 
Search instead for 
Did you mean: 

Permissions/role confusion

cybertoast
Champ in-the-making
Champ in-the-making
I have a role/permission problem that I don't understand. Here's what I did:
* Create site (foo) in /share as a regular userA
* Log in to /alfresco as admin and set the site's permissions to have EVERYONE have Site Collaborator rights (so EVERYONE now has Read, Site Consumer and Site Collaborator)
* Log in as userB to join this site, by calling:

conn=remote.connect("alfresco");
data = {"role":"SiteCollaborator", "person": {"userName" : user.name}};
retval=conn.put("/api/sites/" + publicSite.shortName +
                      "/memberships/" + encodeURIComponent(user.name),
                      jsonUtils.toJSONString(data), "application/json")
This call responds with:

Caused by: org.alfresco.repo.site.SiteServiceException: 00190088 The current user does not have permissions to modify the membership details of the site foo.

This works  fine for all except this one site, and I can't figure out why, or even where to start looking. Is there a role/permission/site-properties cache that I need to clear? Since I've given EVERYONE SiteCollaborator rights on foo shouldn't any new user who logs in be able to run the above PUT request and join foo as SiteCollaborator?
4 REPLIES 4

cybertoast
Champ in-the-making
Champ in-the-making
What's even more confusing to me is that if I set the user's role in /share to SiteConsumer, but in /alfresco leave EVERYONE as SiteCollaborator, I get SiteCollaborator level rights on content on the site in /share. I say this because I can create files and folders in the site, even though my role on the site is SiteConsumer:

url: /alfresco/service/api/sites/eqthsbc/memberships/userB
role: SiteConsumer
authority:
  userName: userB
  lastName: ""
  url: /alfresco/service/api/people/userB
  fullName: userB
  firstName: userB
  authorityType: USER

So I guess the roles set in /alfresco ALWAYS override the values set in /share? I have not tried this with a higher-role set in /share and a lower in /alfresco to see if the user's rights are limited by what's in /alfresco.

Could someone shed some light on what I'm misunderstanding please?

mrogers
Star Contributor
Star Contributor
What version of Alfresco are you using?

Is your site PUBLIC, PRIVATE or MODERATED?

cybertoast
Champ in-the-making
Champ in-the-making
Alfresco version 3.2r2. The site is PUBLIC:

shortName: foo
url: /alfresco/service/api/sites/foo
isPublic: true
description: ""
sitePreset: site-dashboard
visibility: PUBLIC

dacedos
Champ in-the-making
Champ in-the-making
Hi cybertoast,

How do you set permissions to nodes?

I am dealing with authorityservices, permissionservices and noderefs but I cannot set the permissions!

For example, If I have a user called "User1" and file/folder with the noderef "nodeRef" how could I set contributor permissions for that user in that node??

thanks!!