[ 
https://issues.apache.org/jira/browse/JCR-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004015#comment-13004015
 ] 

Thomas Mueller commented on JCR-2910:
-------------------------------------

> flawed design

isAdmin() simply is not flawed design. Within Unix systems, there is a very 
simple way to find out if the user is root.

> encouraging client code... if (session.isAdmin()) { 

So, basically you admit that the only reason for you to be against this feature 
is to make my work harder? :-)

> already outlines two workarounds

I already gave you the reasons why the workarounds are not acceptable.

Acceptable solutions are JackrabbitSession.getUser() (actually I would prefer 
that), or JackrabbitSession.isAdmin(). I fail to see any reason why this would 
be "flawed design".


> 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

Reply via email to