Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

AnmolBhardwaj1808
Level 2
Level 2

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
kchaurasiya
Correct answer by
Level 6
Level 6

@AnmolBhardwaj1808 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
kchaurasiya
Correct answer by
Level 6
Level 6

@AnmolBhardwaj1808 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

AnmolBhardwaj1808
Level 2
Level 2
Thanks @kchaurasiya. After getting the user groups, how do I edit permissions?
kchaurasiya
Level 6
Level 6
@AnmolBhardwaj1808 : I think you can do this through the ACL. You can apply the ACL permission on the user and group. Thanks