cancel
Showing results for 
Search instead for 
Did you mean: 

User's role for the space

bradw
Champ in-the-making
Champ in-the-making
Is there an easy way to determine a user's role for the given space?  I am looking into implementing some custom permission logic which would allow me to prevent a user from having read permissions on any document created by another user with the same role.

For instance, UserA is a Contributor in my space, and creates DocumentA.

UserB, who is also a Contributor logs in and enters the space. I would like them to not see DocumentA.

I didn't want to use explicitly denied permissions because this needs to happen automatically, and it shouldn't be up to the user creating the content to have to do this.

Any thoughts?

Thanks,
Brad
1 REPLY 1

davidc
Star Contributor
Star Contributor
You can use the service interface PermissionService.  It supports the method:

public Set<AccessPermission> getPermissions(NodeRef nodeRef);

This will return the permissions set for the currently authenticated user for the given NodeRef (in this case the node ref of a space).

The Web Client UI now also provides the ability to set permissions on a document by document basis.  It works in a similar fashion to 'Manage Space Users', so you can hide each document from everyone else in the space.