Is there way to get ACL list for given resource path.? | Community
Skip to main content
vmadala
Level 3
July 6, 2021
Solved

Is there way to get ACL list for given resource path.?

  • July 6, 2021
  • 1 reply
  • 1226 views

Hello Experts,

 

I would like to get all allowed users (read/write) list for a given resource path.
Let say I have a user called 'test-user' and I gave read/write permissions for  '/content' folder and all child folders under '/content' folder.
I would like to write a API bypassing a resource path as a request parameter (could be '/content' or any children of '/content')
and get all the allowed users (read/write) for that given path.

I wrote the below code, but it's returning the only configured users for the given resource node.
let say as I said above, 'test-user' configured for '/content' folder and all children, when I called below code for '/content/dam' folder 'test-user' isn't returning.

@Override public JackrabbitAccessControlList getAccessControlList(final @126844 String path) { //Getting resource resolver by using service user ResourceResolver resolver = getResourceResolver(); Resource resource = resolver.getResource(path); Session session = resolver.adaptTo(Session.class); JackrabbitAccessControlList acl = null; try { acl = AccessControlUtils.getAccessControlList(session, resource.getPath()); } catch (RepositoryException e) { logger.error("Failed to retrive the user permission ", e); } return acl; }


Any thoughts.?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Cna you please check if this helps

https://jackrabbit.apache.org/oak/docs/security/permission.html

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 6, 2021
Arun Patidar
vmadala
vmadalaAuthor
Level 3
July 10, 2021
Thanks @arunpatidar, I've achieved the solution. Just FYI, I got all the user from the SQL2 query and used UserManager API to get the permission for given path.