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

can i retrieve the users list and along with their group names in query builder?

Var
Level 5
Level 5

Am using a query debug url for listing out the users and their groups names in a json format link.

The following code snippet is giving me the users list.

p.hits=selective p.limit=-1 p.properties=rep:authorizableId rep:externalId path=/home/users type=rep:User p.properties=jcr:path

and the url JSON link  me the JSON out put of the same.

Now i want to get filter/club the Users list along with group name (or groups list along with members), will it be possible? The resulted JSON i want to use in some exports for other activities.

1 Accepted Solution
vjetty
Correct answer by
Level 4
Level 4

Hi, Krishna

Here I created a sample utility that do the job. Just try it if you just want to export which user belongs to which group. It has some other features as well. 

https://github.com/vamsijetty/useradmin-utility.git

       /**
         * Make sure you create a system user (using /crx/explorer) and give proper permissions to it. 
         * After you successfully create system user (For Ex: local-service-user) please Map that user to your service in 
         * Apache Sling Service User Mapper Service. 
         * Eg.: "com.handsonaem.vamsijetty.useradminutility.core:localservice=local-service-user"
         */

Hope this helps! 

View solution in original post

7 Replies
Var
Level 5
Level 5

smacdonald2008 wrote...

Why not use the User Manager API to retrieve user and group data and encode the result to JSON

https://jackrabbit.apache.org/api/2.0/org/apache/jackrabbit/api/security/user/UserManager.html

 

 

Thanks Scott, I have tried that API way it will workout but, the problem is i have to get the these user data from the production systems, where i am not recommended to deploy a bundle and get this work done, so checking for the front end way if this can be possible by any query builder ?

~VAr

krishnamadhur9
Level 1
Level 1

Hey Var,

 

Any updates on if you were able to achieve this? can I get the query that you wrote. I have pretty much the same requirement as you. I need to retrieve the list of all the Users with the groups they belong to.

 

Regards,

 

Krishna

vjetty
Correct answer by
Level 4
Level 4

Hi, Krishna

Here I created a sample utility that do the job. Just try it if you just want to export which user belongs to which group. It has some other features as well. 

https://github.com/vamsijetty/useradmin-utility.git

       /**
         * Make sure you create a system user (using /crx/explorer) and give proper permissions to it. 
         * After you successfully create system user (For Ex: local-service-user) please Map that user to your service in 
         * Apache Sling Service User Mapper Service. 
         * Eg.: "com.handsonaem.vamsijetty.useradminutility.core:localservice=local-service-user"
         */

Hope this helps! 

View solution in original post

Var
Level 5
Level 5

HI Krishna,

Nope i didn't get a chance to work via Query debug url. we have implemented it via API route.

~VAr

krishnamadhur9
Level 1
Level 1

Thanks a lot Vamsi. I will look into this.