Report for user/group permissions for all levels. | Community
Skip to main content
October 14, 2016
Solved

Report for user/group permissions for all levels.

  • October 14, 2016
  • 2 replies
  • 2273 views

Need to generate detailed report for all user/groups entitlements for all hierarchy (in all levels)  in a cq instance.

Currently through user admin we need to navigate to each group and expand heirarchy to see entitlement for each group. And through access control tab in crxde lite  also we can see the current selected node permissions of the parent but not for child nodes.

So how can we generate detailed report for every user/group in cq instance.

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 smacdonald2008

To generate a report as you describe, you need to write a custom AEM service, Them use the Jackrabbit API to get user/group information. You can use this API to get permissions for groups as described in this article:

http://scottsdigitalcommunity.blogspot.com/2016/03/using-jackrabbit-usermanager-apis-to.html

Then in your custom service, create a collection object that track the data. For example:

ArratList<JavaBean>

Where the JavaBean has data members that store data and there is a 1-1 between group and JavaBean. 

Once you get all of the data, you can export the data to Excel. We have articles that show you how to use Excel API in AEM. 

http://scottsdigitalcommunity.blogspot.com/2013/11/creating-custom-reporting-service-for.html

YOu can go further too and create an AEM scheduler service that will invoke this service on a weekly basis and then have the report emailed to interested stake holders. 

2 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 14, 2016

To generate a report as you describe, you need to write a custom AEM service, Them use the Jackrabbit API to get user/group information. You can use this API to get permissions for groups as described in this article:

http://scottsdigitalcommunity.blogspot.com/2016/03/using-jackrabbit-usermanager-apis-to.html

Then in your custom service, create a collection object that track the data. For example:

ArratList<JavaBean>

Where the JavaBean has data members that store data and there is a 1-1 between group and JavaBean. 

Once you get all of the data, you can export the data to Excel. We have articles that show you how to use Excel API in AEM. 

http://scottsdigitalcommunity.blogspot.com/2013/11/creating-custom-reporting-service-for.html

YOu can go further too and create an AEM scheduler service that will invoke this service on a weekly basis and then have the report emailed to interested stake holders. 

kautuk_sahni
Community Manager
Community Manager
October 17, 2016

Hi,

In JSP / Java you can adapt your resource to UserManager class and get the current user or list down all the users and groups as per your requirement.

To list all the users or groups, you can use findAuthorizables() method available in the UserManger.

You can also obtain the User info in JS using CQ.User.getCurrentUser() which would return an instance of the current User, with which you can access the user's properties.

UserManager API :- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/org/apache/jackrabbit/api/security/user/UserManager.html

How to export the user list to a CSV :- http://blogs.adobe.com/dmcmahon/2012/02/29/cq-5-4-how-to-export-the-user-list-as-a-csv-file/ (Old article, but)

Reference article :- http://www.albinsblog.com/2015/03/how-to-get-userinfo-through-java-api-in.html#.WARbTvl97RY

You need to create ta custom service as per your need.

~kautuk

Kautuk Sahni