public final class PrivilegeManagerImpl extends Object implements org.apache.jackrabbit.api.security.authorization.PrivilegeManager
PrivilegeManager
...Constructor and Description |
---|
PrivilegeManagerImpl(PrivilegeRegistry registry,
NameResolver nameResolver) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this privilege manager
|
PrivilegeBits |
getBits(Name... privilegeNames) |
PrivilegeBits |
getBits(Privilege... privileges) |
Privilege |
getPrivilege(String privilegeName) |
Set<Privilege> |
getPrivileges(PrivilegeBits bits)
Returns an array of registered
Privilege s. |
Privilege[] |
getRegisteredPrivileges() |
void |
privilegesRegistered(Set<Name> privilegeNames) |
Privilege |
registerPrivilege(String privilegeName,
boolean isAbstract,
String[] declaredAggregateNames)
Register a new custom privilege with the specified characteristics.
|
public PrivilegeManagerImpl(PrivilegeRegistry registry, NameResolver nameResolver)
public void dispose()
public Privilege[] getRegisteredPrivileges() throws RepositoryException
getRegisteredPrivileges
in interface org.apache.jackrabbit.api.security.authorization.PrivilegeManager
RepositoryException
PrivilegeManager.getRegisteredPrivileges()
public Privilege getPrivilege(String privilegeName) throws AccessControlException, RepositoryException
getPrivilege
in interface org.apache.jackrabbit.api.security.authorization.PrivilegeManager
AccessControlException
RepositoryException
PrivilegeManager.getPrivilege(String)
public Privilege registerPrivilege(String privilegeName, boolean isAbstract, String[] declaredAggregateNames) throws AccessDeniedException, RepositoryException
The current implementation has the following limitations and constraints:
Please note
Custom privilege(s) will not be enforced for any kind of repository
operations. Those are exclusively covered by the built-in privileges.
This also implies that the Permission
s are not affected by
custom privileges.
Applications making use of the custom privilege(s) are in charge of asserting whether the privileges are granted/denied according to their application specific needs.
registerPrivilege
in interface org.apache.jackrabbit.api.security.authorization.PrivilegeManager
privilegeName
- The name of the new custom privilege.isAbstract
- Boolean flag indicating if the privilege is abstract.declaredAggregateNames
- An array of privilege names referring to
registered privileges being aggregated by this new custom privilege.
In case of a non aggregate privilege an empty array should be passed.AccessDeniedException
- If the session this manager has been created
lacks rep:privilegeManagement privilege.RepositoryException
- If the privilege could not be registered due
to constraint violations or if persisting the custom privilege fails.PrivilegeManager.registerPrivilege(String, boolean, String[])
public PrivilegeBits getBits(Privilege... privileges) throws AccessControlException
privileges
- An array of privileges.AccessControlException
- If the specified array is null, empty
or if it contains an unregistered privilege.public PrivilegeBits getBits(Name... privilegeNames) throws RepositoryException
privilegeNames
- An array of privilege names.AccessControlException
- If the specified array is null or if it
contains the name of an unregistered privilege.RepositoryException
public Set<Privilege> getPrivileges(PrivilegeBits bits)
Privilege
s. If the specified
bits
represent a single registered privilege the returned array
contains a single element. Otherwise the returned array contains the
individual registered privileges that are combined in the given
bits
. If bits
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
bits
or an empty array if bits
cannot be
resolved to registered Privilege
s.getBits(Privilege...)
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.