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

Avatar

Avatar
Boost 5
Level 3
vmadala
Level 3

Likes

21 likes

Total Posts

28 posts

Correct reply

5 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 3
vmadala
Level 3

Likes

21 likes

Total Posts

28 posts

Correct reply

5 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile
vmadala
Level 3

06-07-2021

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 @notnull 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.?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,318 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,318 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

06-07-2021

Answers (0)