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

Var

20-01-2017

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.

Accepted Solutions (1)

Accepted Solutions (1)

vjetty

06-04-2017

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! 

Answers (6)

Answers (6)

krishnamadhur9

06-04-2017

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

Var

23-01-2017

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