Search code examples
jcrmagnolia

Magnolia CMS - check other users permission


I would like to check if a specific user (specified by name, not the current user) has write access to some arbirary path: for example:

"check is user 'foo' has write access to node '/contacts/common/bar'"

So far i can only see methods that allow to check permissions for the current user only. Is there a more generic method that allows for such a check?


Solution

  • Login to AdminCentral as superuser, then go to Tools/Permissions, type in name of the user you want to check, check "show permissions" check box and click on "Get Permission List" button. If you want to do same programatically, check code in info.magnolia.module.admininterface.pages.PermissionPage. It pretty much boils down to getting UserManager, obtaining user from it, then iterating through all the groups and roles assigned to user to obtain all ACLs and then just listing those.

    HTH, Jan