Package org.opencms.security
Interface I_CmsPermissionHandler
- All Known Implementing Classes:
CmsDefaultPermissionHandler
public interface I_CmsPermissionHandler
Permission handler interface.
- Since:
- 7.0.2
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classEnumeration class for the results ofhasPermissions(CmsDbContext, CmsResource, CmsPermissionSet, LockCheck, CmsResourceFilter).static enumEnum for the lock check mode. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final I_CmsPermissionHandler.CmsPermissionCheckResultIndicates allowed permissions.static final I_CmsPermissionHandler.CmsPermissionCheckResultIndicates denied permissions.static final I_CmsPermissionHandler.CmsPermissionCheckResultIndicates a resource was filtered during permission check.static final I_CmsPermissionHandler.CmsPermissionCheckResultIndicates a resource was not locked for a write / control operation. -
Method Summary
Modifier and TypeMethodDescriptionhasPermissions(CmsDbContext dbc, CmsResource resource, CmsPermissionSet requiredPermissions, I_CmsPermissionHandler.LockCheck checkLock, CmsResourceFilter filter) Performs a non-blocking permission check on a resource.voidinit(CmsDriverManager driverManager, CmsSystemConfiguration systemConfiguration) Initializes internal variables needed to work.
-
Field Details
-
PERM_ALLOWED
Indicates allowed permissions. -
PERM_DENIED
Indicates denied permissions. -
PERM_FILTERED
Indicates a resource was filtered during permission check. -
PERM_NOTLOCKED
Indicates a resource was not locked for a write / control operation.
-
-
Method Details
-
hasPermissions
I_CmsPermissionHandler.CmsPermissionCheckResult hasPermissions(CmsDbContext dbc, CmsResource resource, CmsPermissionSet requiredPermissions, I_CmsPermissionHandler.LockCheck checkLock, CmsResourceFilter filter) throws CmsException Performs a non-blocking permission check on a resource.This test will not throw an exception in case the required permissions are not available for the requested operation. Instead, it will return one of the following values:
Despite of the fact that the results of this method are cached, this method should be as fast as possible since it is called really often.
- Parameters:
dbc- the current database contextresource- the resource on which permissions are requiredrequiredPermissions- the set of permissions required for the operationcheckLock- the type of lock check to perform for write operationsfilter- the resource filter to use- Returns:
if the user has sufficient permissions on the resource for the requested operationPERM_ALLOWED- Throws:
CmsException- in case of i/o errors (NOT because of insufficient permissions)
-
init
Initializes internal variables needed to work.- Parameters:
driverManager- the driver managersystemConfiguration- the system configuration instance
-