Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

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

Avatar

Community Advisor

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 6

@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

View solution in original post

4 Replies

Avatar

Correct answer by
Level 6

@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

Avatar

Community Advisor
Thanks @kchaurasiya. After getting the user groups, how do I edit permissions?

Avatar

Level 6
@Anmol_Bhardwaj : I think you can do this through the ACL. You can apply the ACL permission on the user and group. Thanks