jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-2910) Please add JackrabbitSession.isAdmin
Date Tue, 08 Mar 2011 11:16:59 GMT
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

View raw message