Class PrivilegeManagerDelegator
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.delegate.PrivilegeManagerDelegator
-
- All Implemented Interfaces:
PrivilegeManager
public class PrivilegeManagerDelegator extends Object implements PrivilegeManager
This implementation ofPrivilegeManager
delegates back to a delegatee wrapping each call into aSessionOperation
closure.
-
-
Constructor Summary
Constructors Constructor Description PrivilegeManagerDelegator(@NotNull SessionDelegate delegate, @NotNull PrivilegeManager pm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Privilege
getPrivilege(@NotNull String privilegeName)
Returns the privilege with the specifiedprivilegeName
.@NotNull Privilege[]
getRegisteredPrivileges()
Returns all registered privileges.@NotNull Privilege
registerPrivilege(@NotNull String privilegeName, boolean isAbstract, @Nullable String[] declaredAggregateNames)
Creates and registers a new custom privilege with the specified characteristics and returns the new privilege.
-
-
-
Constructor Detail
-
PrivilegeManagerDelegator
public PrivilegeManagerDelegator(@NotNull @NotNull SessionDelegate delegate, @NotNull @NotNull PrivilegeManager pm)
-
-
Method Detail
-
getRegisteredPrivileges
@NotNull public @NotNull Privilege[] getRegisteredPrivileges() throws RepositoryException
Description copied from interface:PrivilegeManager
Returns all registered privileges.- Specified by:
getRegisteredPrivileges
in interfacePrivilegeManager
- Returns:
- all registered privileges.
- Throws:
RepositoryException
- If an error occurs.
-
getPrivilege
@NotNull public @NotNull Privilege getPrivilege(@NotNull @NotNull String privilegeName) throws RepositoryException
Description copied from interface:PrivilegeManager
Returns the privilege with the specifiedprivilegeName
.- Specified by:
getPrivilege
in interfacePrivilegeManager
- Parameters:
privilegeName
- Name of the principal.- Returns:
- the privilege with the specified
privilegeName
. - Throws:
AccessControlException
- If no privilege with the given name exists.RepositoryException
- If another error occurs.
-
registerPrivilege
@NotNull public @NotNull Privilege registerPrivilege(@NotNull @NotNull String privilegeName, boolean isAbstract, @Nullable @Nullable String[] declaredAggregateNames) throws RepositoryException
Description copied from interface:PrivilegeManager
Creates and registers a new custom privilege with the specified characteristics and returns the new privilege.If the registration succeeds, the changes are immediately effective; there is no need to call
save
.- Specified by:
registerPrivilege
in interfacePrivilegeManager
- Parameters:
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.- Returns:
- the new privilege.
- Throws:
AccessDeniedException
- If the session this manager has been created for is not allowed to register new privileges.NamespaceException
- If any of the specified JCR names is illegal.RepositoryException
- If the privilege could not be registered due to any implementation specific constraint violations or if persisting the custom privilege fails.
-
-