[ https://issues.apache.org/jira/browse/JCR-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003915#comment-13003915 ]
Jukka Zitting commented on JCR-2910: ------------------------------------ What's your use case for knowing whether the session is an admin session? Normally the admin status of a session should only be visible to a client as full access to all repository content. If we do need such a check for admin status, I'd rather implement it as something like session.checkPermission("/", "admin") instead of introducing a new method for this. > Please add JackrabbitSession.isAdmin > ------------------------------------ > > Key: JCR-2910 > URL: https://issues.apache.org/jira/browse/JCR-2910 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Reporter: Thomas Mueller > Priority: Minor > > Currently finding out if the session user is an admin requires: > JackrabbitSession js = (JackrabbitSession) session; > User user = ((User) js.getUserManager().getAuthorizable(session.getUserID())); > boolean isAdmin = user.isAdmin(); > Or: ((SessionImpl) session).isAdmin(). However casting to an implementation > is problematic for several reasons. > I think it would make sense to add isAdmin() to the JackrabbitSession > interface, so the code above would be: > ((JackrabbitSession) session).isAdmin() -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira