cancel
Showing results for 
Search instead for 
Did you mean: 

Check for specific permission given a group permission

mruflin
Champ in-the-making
Champ in-the-making
I have a hard time understanding one specific part of the security APIs.

Situation: For some nodes we set specific users and groups to have specific roles, e.g. Consumer or Coordinator.

In different situations I need to be able to tell which users/groups have  a specific right on a given node, e.g "write" access.

I can get the permissions through PermissionsService.getAllSetPermissions, which will me return a list like

  User1: Consumer
  Group1: Consumer
  Group2: Coordinator

Question:

How can I now find out who of those authorities has a "write" permission? In this case it would be the Coordinator only.
Different example of the same problem: How can I find out whether or not the "Coordinator" contains the "Consumer" permission?

ps:
API version: E2.0.1
Our application is integrated in Alfresco using Spring, we can therefore access whatever object is available through that context.
1 REPLY 1

andy
Champ on-the-rise
Champ on-the-rise
Hi

See org.alfresco.repo.security.permissions.impl.ModelDAO and getGranteePermissions.

You will want the permissionsModelDAO bean.

Andy