javax.jcr.security.AccessControlPolicyIterator Java Examples

The following examples show how to use javax.jcr.security.AccessControlPolicyIterator. 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: JackrabbitAccessControlListUtil.java    From APM with Apache License 2.0 5 votes vote down vote up
public static JackrabbitAccessControlList getApplicableAccessControlList(
		final AccessControlManager accessManager, final String path) throws RepositoryException {
	// find policies which may be applied to node indicated by path (may be treated as policy factory)
	final AccessControlPolicyIterator applicablePolicies = accessManager.getApplicablePolicies(path);
	while (applicablePolicies.hasNext()) {
		final AccessControlPolicy policy = applicablePolicies.nextAccessControlPolicy();
		if (policy instanceof JackrabbitAccessControlList) {
			return (JackrabbitAccessControlList) policy;
		}
	}
	return null;
}
 
Example #2
Source File: JackrabbitACLImporter.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
T getApplicablePolicy(Class<T> clz) throws RepositoryException {
    AccessControlPolicyIterator iter = acMgr.getApplicablePolicies(accessControlledPath);
    while (iter.hasNext()) {
        AccessControlPolicy p = iter.nextAccessControlPolicy();
        if (clz.isAssignableFrom(p.getClass())) {
            return (T) p;
        }
    }

    // no applicable policy
    throw new RepositoryException("no applicable AccessControlPolicy of type "+ clz + " on " +
            (accessControlledPath == null ? "'root'" : accessControlledPath));
}
 
Example #3
Source File: AccessControlManagerWrapper.java    From sling-whiteboard with Apache License 2.0 4 votes vote down vote up
@Override
public AccessControlPolicyIterator getApplicablePolicies(String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException {
    return delegate.getApplicablePolicies(absPath);
}