|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils
public class AccessControlUtils
This class provides common access control related utilities.
| Constructor Summary | |
|---|---|
AccessControlUtils()
|
|
| Method Summary | |
|---|---|
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(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 Privilege[] |
privilegesFromNames(Session session,
String... privilegeNames)
Retrieves the Privileges from the specified privilege names. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AccessControlUtils()
| Method Detail |
|---|
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 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 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 node
true 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 node
true if the node's access control list was modified;
false otherwise;
RepositoryException - If an error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||