org.opencms.security
Class CmsDefaultPermissionHandler

java.lang.Object
  extended by org.opencms.security.CmsDefaultPermissionHandler
All Implemented Interfaces:
I_CmsPermissionHandler

public class CmsDefaultPermissionHandler
extends java.lang.Object
implements I_CmsPermissionHandler

Generic base driver interface.

Since:
7.0.2
Version:
$Revision: 1.10 $
Author:
Michael Moossen

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opencms.security.I_CmsPermissionHandler
I_CmsPermissionHandler.CmsPermissionCheckResult
 
Field Summary
protected  CmsDriverManager m_driverManager
          Driver Manager instance.
protected  CmsSecurityManager m_securityManager
          Security Manager instance.
 
Fields inherited from interface org.opencms.security.I_CmsPermissionHandler
PERM_ALLOWED, PERM_DENIED, PERM_FILTERED, PERM_NOTLOCKED
 
Constructor Summary
CmsDefaultPermissionHandler()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_driverManager

protected CmsDriverManager m_driverManager
Driver Manager instance.


m_securityManager

protected CmsSecurityManager m_securityManager
Security Manager instance.

Constructor Detail

CmsDefaultPermissionHandler

public CmsDefaultPermissionHandler()
Method Detail

hasPermissions

public I_CmsPermissionHandler.CmsPermissionCheckResult hasPermissions(CmsDbContext dbc,
                                                                      CmsResource resource,
                                                                      CmsPermissionSet requiredPermissions,
                                                                      boolean checkLock,
                                                                      CmsResourceFilter filter)
                                                               throws CmsException
Description copied from interface: I_CmsPermissionHandler
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.

Specified by:
hasPermissions in interface I_CmsPermissionHandler
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:
I_CmsPermissionHandler.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)
See Also:
I_CmsPermissionHandler.hasPermissions(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, org.opencms.security.CmsPermissionSet, boolean, org.opencms.file.CmsResourceFilter)

init

public void init(CmsDriverManager driverManager,
                 CmsSystemConfiguration systemConfiguration)
Description copied from interface: I_CmsPermissionHandler
Initializes internal variables needed to work.

Specified by:
init in interface I_CmsPermissionHandler
Parameters:
driverManager - the driver manager
systemConfiguration - the system configuration instance
See Also:
I_CmsPermissionHandler.init(org.opencms.db.CmsDriverManager, CmsSystemConfiguration)