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(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(Privilege[] privileges)
Deprecated.
|
Privilege |
getPrivilege(String privilegeName)
Deprecated.
Use
PrivilegeManager.getPrivilege(String) instead. |
Privilege[] |
getPrivileges(int bits)
Deprecated.
Use
PrivilegeManagerImpl.getPrivileges(PrivilegeBits) instead. |
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(NamespaceRegistry namespaceRegistry, FileSystem fs) throws RepositoryException
PrivilegeRegistry
instance.namespaceRegistry
- fs
- RepositoryException
public PrivilegeRegistry(NameResolver resolver)
PrivilegeManager
instead.PrivilegeRegistry
instance defining only
built-in privileges.resolver
- JackrabbitWorkspace.getPrivilegeManager()
public void externalRegisteredPrivileges(Collection<PrivilegeDefinition> definitions) throws RepositoryException
externalRegisteredPrivileges
in interface PrivilegeEventListener
definitions
- privilege definitionsRepositoryException
- if an error occursPrivilegeEventListener.externalRegisteredPrivileges(java.util.Collection)
public void setEventChannel(PrivilegeEventChannel eventChannel)
eventChannel
- event channelpublic Privilege[] getRegisteredPrivileges()
PrivilegeManager.getRegisteredPrivileges()
instead.UnsupportedOperationException
.public Privilege getPrivilege(String privilegeName) throws AccessControlException, RepositoryException
PrivilegeManager.getPrivilege(String)
instead.PrivilegeManager
from the specified resolver
and calls PrivilegeManagerImpl.getRegisteredPrivileges()
.privilegeName
- Name of the privilege.privilegeName
.AccessControlException
- If no privilege with the given name exists.RepositoryException
- If another error occurs.public 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(Privilege[] privileges) throws AccessControlException
PrivilegeManagerImpl.getBits(javax.jcr.security.Privilege...)
instead.UnsupportedOperationException
if the workaround fails.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(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–2021 The Apache Software Foundation. All rights reserved.