Not extracting all member of AEM group when user do not have admin rights. | Community
Skip to main content
chetan001
Level 3
September 15, 2021
Solved

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

  • September 15, 2021
  • 2 replies
  • 926 views

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()

}

 

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 Asutosh_Jena_

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!

2 replies

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
September 15, 2021

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!

joerghoh
Adobe Employee
Adobe Employee
September 17, 2021

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.