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

Jukka Zitting commented on JCR-2910:
------------------------------------

> backup the file system [...] doesn't work with virtual repositories

So you want a backup feature that should both work with virtual repositories 
(that could be backed by anything), but still want to have the backup feature 
work on the file system level. I don't think that's a good idea.

What we should do instead, is to have something like JackrabbitSession.backup 
(or RepositoryManager.backup) that takes care of all the required low-level 
functionality. Then a virtual repository can just decide whether it wants to 
direct the backup() call to just one "main" repository or try to combine the 
backups from multiple backend repositories. The Jackrabbit implementation of 
such a method would be in SessionImpl.backup(), where accessing the 
SessionImpl.isAdmin() method is no problem.

> 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