How Do I change/set permissions for different users to only access certain folders in the DAM? | Community
Skip to main content
Anmol_Bhardwaj
Community Advisor
Community Advisor
July 1, 2021
Solved

How Do I change/set permissions for different users to only access certain folders in the DAM?

  • July 1, 2021
  • 1 reply
  • 2124 views

I am using AEM 6.5 , and I need to set permissions for different user groups to only access certain folders in DAM depending upon some rules. I have been trying to find the right example where this has been implemented but was not able to find it. Can you please point me in the right direction.

 

I want to get user groups and and users in Java through JCR and their permissions and add/remove permissions through Java only.

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 kchaurasiya

@anmol_bhardwaj As you want to achieve it through the java code then you can user the userManager API to get the user and the groups and later you can add the permissions.

UserManager userManager = resolver.adaptTo(UserManager.class);

From userManager get the groups.

Group Group1 = (Group) userManager.getAuthorizable(CONTENTAUTHOR);

 Thank You.

Keshav Chaurasiya

1 reply

kchaurasiya
kchaurasiyaAccepted solution
Level 5
July 1, 2021

@anmol_bhardwaj As you want to achieve it through the java code then you can user the userManager API to get the user and the groups and later you can add the permissions.

UserManager userManager = resolver.adaptTo(UserManager.class);

From userManager get the groups.

Group Group1 = (Group) userManager.getAuthorizable(CONTENTAUTHOR);

 Thank You.

Keshav Chaurasiya

kchaurasiya
Level 5
July 1, 2021