org.apache.jackrabbit.api.security.JackrabbitAccessControlManager Java Examples

The following examples show how to use org.apache.jackrabbit.api.security.JackrabbitAccessControlManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SessionWrapper.java    From sling-whiteboard with Apache License 2.0 5 votes vote down vote up
@Override
public AccessControlManager getAccessControlManager() throws UnsupportedRepositoryOperationException, RepositoryException {
    AccessControlManager manager = this.wrappedSession.getAccessControlManager();
    return manager instanceof JackrabbitAccessControlManager ?
            new JackrabbitAccessControlManagerWrapper(this, (JackrabbitAccessControlManager) manager) :
            new AccessControlManagerWrapper<>(this, manager);
}
 
Example #2
Source File: JackrabbitACLImporter.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
T getPolicy(Class<T> clz, Principal principal) throws RepositoryException {
    if (acMgr instanceof JackrabbitAccessControlManager) {
        for (AccessControlPolicy p : ((JackrabbitAccessControlManager) acMgr).getPolicies(principal)) {
            if (clz.isAssignableFrom(p.getClass())) {
                return (T) p;
            }
        }
    }
    return null;
}
 
Example #3
Source File: JackrabbitACLImporter.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
T getApplicablePolicy(Class<T> clz, Principal principal) throws RepositoryException {
    if (acMgr instanceof JackrabbitAccessControlManager) {
        for (AccessControlPolicy p : ((JackrabbitAccessControlManager) acMgr).getApplicablePolicies(principal)) {
            if (clz.isAssignableFrom(p.getClass())) {
                return (T) p;
            }
        }
    }

    // no applicable policy
    throw new AccessControlException("no applicable AccessControlPolicy of type "+ clz + " for " + principal.getName());
}
 
Example #4
Source File: JackrabbitAccessControlManagerWrapper.java    From sling-whiteboard with Apache License 2.0 4 votes vote down vote up
public JackrabbitAccessControlManagerWrapper(SessionWrapper<?> sessionWrapper, JackrabbitAccessControlManager delegate) {
    super(sessionWrapper, delegate);
}