use of org.apache.jackrabbit.core.security.authorization.AccessControlEditor in project jackrabbit by apache.
the class CombinedEditor method removePolicy.
/**
* @see AccessControlEditor#removePolicy(String,AccessControlPolicy)
*/
public void removePolicy(String nodePath, AccessControlPolicy policy) throws AccessControlException, PathNotFoundException, RepositoryException {
for (AccessControlEditor editor : editors) {
try {
// return as soon as the first editor successfully handled the
// specified template
editor.removePolicy(nodePath, policy);
log.debug("Removed template " + policy + " using " + editor);
return;
} catch (AccessControlException e) {
log.debug(e.getMessage());
// ignore and try next
}
}
// neither of the editors was able to remove a policy at nodePath
throw new AccessControlException("Unable to remove template " + policy);
}
use of org.apache.jackrabbit.core.security.authorization.AccessControlEditor in project jackrabbit by apache.
the class CombinedEditor method setPolicy.
/**
* @see AccessControlEditor#setPolicy(String,AccessControlPolicy)
*/
public void setPolicy(String nodePath, AccessControlPolicy template) throws AccessControlException, PathNotFoundException, RepositoryException {
for (AccessControlEditor editor : editors) {
try {
// return as soon as the first editor successfully handled the
// specified template
editor.setPolicy(nodePath, template);
log.debug("Set template " + template + " using " + editor);
return;
} catch (AccessControlException e) {
log.debug(e.getMessage());
// ignore and try next
}
}
// none accepted -> throw
throw new AccessControlException("None of the editors accepted policy " + template + " at " + nodePath);
}
use of org.apache.jackrabbit.core.security.authorization.AccessControlEditor in project jackrabbit by apache.
the class CombinedProvider method getEditor.
/**
* @see AccessControlProvider#getEditor(javax.jcr.Session)
*/
public AccessControlEditor getEditor(Session editingSession) {
checkInitialized();
List<AccessControlEditor> editors = new ArrayList<AccessControlEditor>();
for (AccessControlProvider provider : providers) {
try {
editors.add(provider.getEditor(editingSession));
} catch (RepositoryException e) {
log.debug(e.getMessage());
// ignore.
}
}
if (!editors.isEmpty()) {
return new CombinedEditor(editors.toArray(new AccessControlEditor[editors.size()]));
} else {
log.debug("None of the derived access control providers supports editing.");
return null;
}
}
Aggregations