use of org.apache.jackrabbit.rmi.remote.principal.RemotePrincipal in project jackrabbit by apache.
the class ServerAccessControlList method addAccessControlEntry.
public boolean addAccessControlEntry(RemotePrincipal principal, RemotePrivilege[] privileges) throws RepositoryException {
Principal p = null;
if (principal instanceof ServerPrincipal) {
p = ((ServerPrincipal) principal).getPrincipal();
}
Privilege[] privs = new Privilege[privileges.length];
for (int i = 0; privs != null && i < privs.length; i++) {
if (privileges[i] instanceof ServerPrivilege) {
privs[i] = ((ServerPrivilege) privileges[i]).getPrivilege();
} else {
// not a compatible remote privilege, abort
privs = null;
}
}
if (p != null && privs != null) {
return ((AccessControlList) getAccessControlPolicy()).addAccessControlEntry(p, privs);
}
throw new RepositoryException("Unsupported Remote types");
}
Aggregations