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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Not extracting all member of AEM group when user do not have admin rights.

chetan001
Level 2
Level 2

Hello All,

 

As a admin user I see all members are extracting  from AEM group. But when user have less access then he is not able to extract other users

 

Working Case : =  Admin User , he can extract all three users

 

Group Name : regional_asia

Member  :  user1, user2,user3

 

 

 

Problem Case:

 

Login User :=  User1  “ he does not have admin access”, has less access, so when extracting user, he only able to extract itself ,not user2 and user3

 

Group Name : regional_asia

Member  :  user1, user2,user3

 

 

 

Code :

 

group = (Group) userManager.getAuthorizable(Constants.GROUP_EDITOR_APAC);

if(group != null) {

                           final Iterator<Authorizable> memberslist = group.getMembers();

                           while (memberslist.hasNext()) {

                                  final Authorizable user = memberslist.next();

                                  if (user != null && !user.isGroup() && user.getProperty("./profile/email") != null) {

                                         //EMAIL ADDRESS FOR MEMBERS

                                         Value[] usrEmail = user.getProperty("./profile/email");

                                         for(Value emailGroup : usrEmail) {

                                                String member = emailGroup.toString()

}

 

1 Accepted Solution
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

Hi @chetan001 

 

Please create a system user and assign appropriate path permission to the system user.

Now using the system user in your code, try to access the userManager API and it will have the same behavior as of admin user.

 

Here is the link which talks about the creation of system user:

https://www.argildx.com/technology/ensure-service-user-an-acs-aem-commons-utility/

 

Thanks!

View solution in original post

2 Replies
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

Hi @chetan001 

 

Please create a system user and assign appropriate path permission to the system user.

Now using the system user in your code, try to access the userManager API and it will have the same behavior as of admin user.

 

Here is the link which talks about the creation of system user:

https://www.argildx.com/technology/ensure-service-user-an-acs-aem-commons-utility/

 

Thanks!

View solution in original post

Jörg_Hoh
Employee
Employee

This is a permission topic. By default a user just has access to its own account, and does not see other users which are also able to login into the system. 

If you cannot give the users general read access to the user nodes of the other users (I would not do that), but just want to display other users in a very specific context, you can use a ResourceResolver/Session with elevated privileges as @asutosh_jena  already mentioned.