|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.security.authorization.PrivilegeRegistry
public final class PrivilegeRegistry
The PrivilegeRegistry
defines the set of Privilege
s
known to the repository.
Field Summary | |
---|---|
static int |
NO_PRIVILEGE
|
static String |
REP_WRITE
Jackrabbit specific write privilege that combines Privilege.JCR_WRITE
and Privilege.JCR_NODE_TYPE_MANAGEMENT . |
Constructor Summary | |
---|---|
PrivilegeRegistry(NameResolver resolver)
Create a new PrivilegeRegistry instance. |
Method Summary | |
---|---|
static int |
calculatePermissions(int privs,
int parentPrivs,
boolean isAllow,
boolean protectsPolicy)
Build the permissions granted by evaluating the given privileges. |
static int |
getBits(Privilege[] privileges)
|
Privilege |
getPrivilege(String privilegeName)
Returns the privilege with the specified privilegeName . |
Privilege[] |
getPrivileges(int bits)
Returns an array of registered Privilege s. |
Privilege[] |
getRegisteredPrivileges()
Returns all registered privileges. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REP_WRITE
Privilege.JCR_WRITE
and Privilege.JCR_NODE_TYPE_MANAGEMENT
.
public static final int NO_PRIVILEGE
Constructor Detail |
---|
public PrivilegeRegistry(NameResolver resolver)
PrivilegeRegistry
instance.
resolver
- NameResolver used to calculate the JCR name of the
privileges.Method Detail |
---|
public Privilege[] getRegisteredPrivileges()
public Privilege getPrivilege(String privilegeName) throws AccessControlException, RepositoryException
privilegeName
.
privilegeName
- Name of the principal.
privilegeName
.
AccessControlException
- If no privilege with the given name exists.
RepositoryException
- If another error occurs.public Privilege[] getPrivileges(int bits)
Privilege
s. If the specified
bits
represent a registered privilege the returned array
contains a single element. Otherwise the returned array contains the
individual registered privileges that are combined in the givent
bits
. If bits
is 0
or
does not match to any registered privilege an empty array will be returned.
bits
- Privilege bits as obtained from getBits(Privilege[])
.
Privilege
s that are presented by the given it
or an empty array if bits
is lower than READ
or
cannot be resolved to registered Privilege
s.getBits(Privilege[])
public static int getBits(Privilege[] privileges) throws AccessControlException
privileges
- An array of privileges.
AccessControlException
- If the specified array is null
or if it contains an unregistered privilege.getPrivileges(int)
public static int calculatePermissions(int privs, int parentPrivs, boolean isAllow, boolean protectsPolicy)
privs
- The privileges granted on the Node itself (for properties
the ACL of the direct ancestor).parentPrivs
- The privileges granted on the parent of the Node. Not
relevant for properties since it only is used to determine permissions
on a Node (add_child_nodes, remove_child_nodes).isAllow
- true
if the privileges are granted; false
otherwise.protectsPolicy
- If true
the affected item itself
defines access control related information.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |