How to get list of Users/Group with specific privileges for the given content?

Avatar

Avatar

jura_khrapunov

Avatar

jura_khrapunov

jura_khrapunov

15-10-2015

In a large organization we have multiple divisions and publishing workflow is pretty decentralized.

Is there any way how I can programmatically get a list of Users/Groups which have certain explicit (not inherited) permissions set for the given content path?

Example:

There is a "global editors" group which has REPLICATE permissions for the whole /content namespace. Another group "editors X" has REPLICATE permission set for /content/x branch. And yet another group "local editors" assigned to the /content/x/local node. How I can get only "local editors" group for the node /content/x/local? 

View Entire Topic

Avatar

Avatar

anjali_biddanda

Avatar

anjali_biddanda

anjali_biddanda

06-10-2020

You can do this: 

Authorizable userGroup = userManager.getAuthorizable("test-usergroup");
JackrabbitAccessControlManager jMgr = (JackrabbitAccessControlManager) adminSession.getAccessControlManager();
jMgr.hasPrivileges(path, Collections.singleton(userGroup.getPrincipal()), privileges);