org.opencms.security
Interface I_CmsPermissionHandler

All Known Implementing Classes:
CmsDefaultPermissionHandler

public interface I_CmsPermissionHandler

Permission handler interface.

Since:
7.0.2
Version:
$Revision: 1.7 $
Author:
Michael Moossen
See Also:
CmsSecurityManager.hasPermissions(org.opencms.file.CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)

Nested Class Summary
static class I_CmsPermissionHandler.CmsPermissionCheckResult
          Enumeration class for the results of hasPermissions(CmsDbContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter).
 
Field Summary
static I_CmsPermissionHandler.CmsPermissionCheckResult PERM_ALLOWED
          Indicates allowed permissions.
static I_CmsPermissionHandler.CmsPermissionCheckResult PERM_DENIED
          Indicates denied permissions.
static I_CmsPermissionHandler.CmsPermissionCheckResult PERM_FILTERED
          Indicates a resource was filtered during permission check.
static I_CmsPermissionHandler.CmsPermissionCheckResult PERM_NOTLOCKED
          Indicates a resource was not locked for a write / control operation.
 
Method Summary
 I_CmsPermissionHandler.CmsPermissionCheckResult hasPermissions(CmsDbContext dbc, CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter)
          Performs a non-blocking permission check on a resource.
 void init(CmsDriverManager driverManager, CmsSystemConfiguration systemConfiguration)
          Initializes internal variables needed to work.
 

Field Detail

PERM_ALLOWED

static final I_CmsPermissionHandler.CmsPermissionCheckResult PERM_ALLOWED
Indicates allowed permissions.


PERM_DENIED

static final I_CmsPermissionHandler.CmsPermissionCheckResult PERM_DENIED
Indicates denied permissions.


PERM_FILTERED

static final I_CmsPermissionHandler.CmsPermissionCheckResult PERM_FILTERED
Indicates a resource was filtered during permission check.


PERM_NOTLOCKED

static final I_CmsPermissionHandler.CmsPermissionCheckResult PERM_NOTLOCKED
Indicates a resource was not locked for a write / control operation.

Method Detail

hasPermissions

I_CmsPermissionHandler.CmsPermissionCheckResult hasPermissions(CmsDbContext dbc,
                                                               CmsResource resource,
                                                               CmsPermissionSet requiredPermissions,
                                                               boolean 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 context
resource - the resource on which permissions are required
requiredPermissions - the set of permissions required for the operation
checkLock - if true, a lock for the current user is required for all write operations, if false it's ok to write as long as the resource is not locked by another user
filter - the resource filter to use
Returns:
PERM_ALLOWED if the user has sufficient permissions on the resource for the requested operation
Throws:
CmsException - in case of i/o errors (NOT because of insufficient permissions)

init

void init(CmsDriverManager driverManager,
          CmsSystemConfiguration systemConfiguration)
Initializes internal variables needed to work.

Parameters:
driverManager - the driver manager
systemConfiguration - the system configuration instance