public class AccessControlUtils extends Object
| Constructor and Description |
|---|
AccessControlUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addAccessControlEntry(Session session,
String absPath,
Principal principal,
Privilege[] privileges,
boolean isAllow)
A utility method to add a new access control entry.
|
static boolean |
addAccessControlEntry(Session session,
String absPath,
Principal principal,
String[] privilegeNames,
boolean isAllow)
A utility method to add a new access control entry.
Please note, that calling Session.save()() is required
in order to persist the changes. |
static boolean |
denyAllToEveryone(Session session,
String absPath)
Utility to deny jcr:all privilege to the everyone group principal.
|
static org.apache.jackrabbit.api.security.JackrabbitAccessControlList |
getAccessControlList(AccessControlManager accessControlManager,
String absPath)
Utility that combines
AccessControlManager.getApplicablePolicies(String)
and AccessControlManager.getPolicies(String) to retrieve
a modifiable JackrabbitAccessControlList for the given path.Note that the policy must be reapplied
and the changes must be saved in order to make the AC modifications take
effect. |
static org.apache.jackrabbit.api.security.JackrabbitAccessControlList |
getAccessControlList(Session session,
String absPath)
Utility that combines
AccessControlManager.getApplicablePolicies(String)
and AccessControlManager.getPolicies(String) to retrieve
a modifiable JackrabbitAccessControlList for the given path.Note that the policy must be reapplied
and the changes must be saved in order to make the AC modifications take
effect. |
static boolean |
grantAllToEveryone(Session session,
String absPath)
Utility to grant jcr:all privilege to the everyone group principal.
|
static String[] |
namesFromPrivileges(Privilege... privileges)
Retrieves the names of the specified privileges.
|
static Privilege[] |
privilegesFromNames(AccessControlManager accessControlManager,
String... privilegeNames)
Retrieves the
Privileges from the specified privilege names. |
static Privilege[] |
privilegesFromNames(Session session,
String... privilegeNames)
Retrieves the
Privileges from the specified privilege names. |
public static Privilege[] privilegesFromNames(Session session, String... privilegeNames) throws RepositoryException
Privileges from the specified privilege names.session - The editing session.privilegeNames - The privilege names.RepositoryException - If an error occurs or if privilegeNames
contains an unknown/invalid privilege name.public static Privilege[] privilegesFromNames(AccessControlManager accessControlManager, String... privilegeNames) throws RepositoryException
Privileges from the specified privilege names.accessControlManager - The access control manager.privilegeNames - The privilege names.RepositoryException - If an error occurs or if privilegeNames
contains an unknown/invalid privilege name.public static String[] namesFromPrivileges(Privilege... privileges)
privileges - One or more privileges.public static org.apache.jackrabbit.api.security.JackrabbitAccessControlList getAccessControlList(Session session, String absPath) throws RepositoryException
AccessControlManager.getApplicablePolicies(String)
and AccessControlManager.getPolicies(String) to retrieve
a modifiable JackrabbitAccessControlList for the given path.reapplied
and the changes must be saved in order to make the AC modifications take
effect.session - The editing session.absPath - The absolute path of the target node.RepositoryException - If an error occurs.public static org.apache.jackrabbit.api.security.JackrabbitAccessControlList getAccessControlList(AccessControlManager accessControlManager, String absPath) throws RepositoryException
AccessControlManager.getApplicablePolicies(String)
and AccessControlManager.getPolicies(String) to retrieve
a modifiable JackrabbitAccessControlList for the given path.reapplied
and the changes must be saved in order to make the AC modifications take
effect.accessControlManager - The AccessControlManager .absPath - The absolute path of the target node.RepositoryException - If an error occurs.public static boolean addAccessControlEntry(Session session, String absPath, Principal principal, String[] privilegeNames, boolean isAllow) throws RepositoryException
Session.save()() is required
in order to persist the changes.session - The editing session.absPath - The absolute path of the target node.principal - The principal to grant/deny privileges to.privilegeNames - The names of the privileges to grant or deny.isAllow - true to grant; false otherwise.true if the node's ACL was modified and the session has
pending changes.RepositoryException - If an error occurs.public static boolean addAccessControlEntry(Session session, String absPath, Principal principal, Privilege[] privileges, boolean isAllow) throws RepositoryException
Session.save()() is required in order
to persist the changes.session - The editing sessionabsPath - The absolute path of the target node.principal - The principal to grant/deny privileges to.privileges - The privileges to grant or denyisAllow - true to grant; false otherwise;true if the node's ACL was modified and the session has
pending changes.RepositoryException - If an error occurs.public static boolean grantAllToEveryone(Session session, String absPath) throws RepositoryException
Session.save()() is required in order
to persist the changes.session - The editing session.absPath - The absolute path of the target nodetrue if the node's access control list was modified;
false otherwise;RepositoryException - If an error occurs.public static boolean denyAllToEveryone(Session session, String absPath) throws RepositoryException
Session.save()() is required in order
to persist the changes.session - The editing session.absPath - The absolute path of the target nodetrue if the node's access control list was modified;
false otherwise;RepositoryException - If an error occurs.Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.