public final class PrivilegeRegistry extends Object implements PrivilegeEventListener
PrivilegeRegistry
defines the set of Privilege
s
known to the repository.Modifier and Type | Field and Description |
---|---|
static int |
NO_PRIVILEGE
No privileges
|
static String |
REP_PRIVILEGE_MANAGEMENT
Jackrabbit specific privilege for privilege management.
|
static Name |
REP_PRIVILEGE_MANAGEMENT_NAME |
static String |
REP_WRITE
Jackrabbit specific write privilege that combines
Privilege.JCR_WRITE
and Privilege.JCR_NODE_TYPE_MANAGEMENT . |
static Name |
REP_WRITE_NAME |
Constructor and Description |
---|
PrivilegeRegistry(NameResolver resolver)
Deprecated.
Use
PrivilegeManager instead. |
PrivilegeRegistry(javax.jcr.NamespaceRegistry namespaceRegistry,
FileSystem fs)
Create a new
PrivilegeRegistry instance. |
Modifier and Type | Method and Description |
---|---|
static int |
calculatePermissions(int privs,
int parentPrivs,
boolean isAllow,
boolean protectsPolicy)
Deprecated.
|
static int |
calculatePermissions(PrivilegeBits privs,
PrivilegeBits parentPrivs,
boolean isAllow,
boolean protectsPolicy)
Build the permissions granted by evaluating the given privileges.
|
void |
externalRegisteredPrivileges(Collection<PrivilegeDefinition> definitions)
Called when one or more privilege definitions have been externally registered.
|
static int |
getBits(javax.jcr.security.Privilege[] privileges)
Deprecated.
|
javax.jcr.security.Privilege |
getPrivilege(String privilegeName)
Deprecated.
Use
PrivilegeManager.getPrivilege(String) instead. |
javax.jcr.security.Privilege[] |
getPrivileges(int bits)
Deprecated.
Use
PrivilegeManagerImpl.getPrivileges(PrivilegeBits) instead. |
javax.jcr.security.Privilege[] |
getRegisteredPrivileges()
Deprecated.
Use
PrivilegeManager.getRegisteredPrivileges() instead. |
void |
removeListener(org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry.Listener listener)
Removes a privilege registration listener.
|
void |
setEventChannel(PrivilegeEventChannel eventChannel)
Set a clustering event channel to inform about changes.
|
public static final String REP_WRITE
Privilege.JCR_WRITE
and Privilege.JCR_NODE_TYPE_MANAGEMENT
.public static final Name REP_WRITE_NAME
public static final String REP_PRIVILEGE_MANAGEMENT
public static final Name REP_PRIVILEGE_MANAGEMENT_NAME
public static final int NO_PRIVILEGE
public PrivilegeRegistry(javax.jcr.NamespaceRegistry namespaceRegistry, FileSystem fs) throws javax.jcr.RepositoryException
PrivilegeRegistry
instance.namespaceRegistry
- fs
- javax.jcr.RepositoryException
public PrivilegeRegistry(NameResolver resolver)
PrivilegeManager
instead.PrivilegeRegistry
instance defining only
built-in privileges.resolver
- JackrabbitWorkspace.getPrivilegeManager()
public void externalRegisteredPrivileges(Collection<PrivilegeDefinition> definitions) throws javax.jcr.RepositoryException
externalRegisteredPrivileges
in interface PrivilegeEventListener
definitions
- privilege definitionsjavax.jcr.RepositoryException
- if an error occursPrivilegeEventListener.externalRegisteredPrivileges(java.util.Collection)
public void setEventChannel(PrivilegeEventChannel eventChannel)
eventChannel
- event channelpublic javax.jcr.security.Privilege[] getRegisteredPrivileges()
PrivilegeManager.getRegisteredPrivileges()
instead.UnsupportedOperationException
.public javax.jcr.security.Privilege getPrivilege(String privilegeName) throws javax.jcr.security.AccessControlException, javax.jcr.RepositoryException
PrivilegeManager.getPrivilege(String)
instead.PrivilegeManager
from the specified resolver
and calls PrivilegeManagerImpl.getRegisteredPrivileges()
.privilegeName
- Name of the privilege.privilegeName
.javax.jcr.security.AccessControlException
- If no privilege with the given name exists.javax.jcr.RepositoryException
- If another error occurs.public javax.jcr.security.Privilege[] getPrivileges(int bits)
PrivilegeManagerImpl.getPrivileges(PrivilegeBits)
instead.PrivilegeManager
from the specified resolver
and calls PrivilegeManagerImpl.getPrivileges(PrivilegeBits)
.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(javax.jcr.security.Privilege[] privileges) throws javax.jcr.security.AccessControlException
PrivilegeManagerImpl.getBits(javax.jcr.security.Privilege...)
instead.UnsupportedOperationException
if the workaround fails.privileges
- An array of privileges.javax.jcr.security.AccessControlException
- If the specified array is null
or if it contains an unregistered privilege.getPrivileges(int)
public static int calculatePermissions(PrivilegeBits privs, PrivilegeBits 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.public static int calculatePermissions(int privs, int parentPrivs, boolean isAllow, boolean protectsPolicy)
calculatePermissions(PrivilegeBits, PrivilegeBits, boolean, boolean)
instead.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.public void removeListener(org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry.Listener listener)
listener
- Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.