org.caleigo.core
Class DataAccessManager.ConstantDataAccessManager

java.lang.Object
  extended byorg.caleigo.core.DataAccessManager
      extended byorg.caleigo.core.DataAccessManager.ConstantDataAccessManager
Enclosing class:
DataAccessManager

public static class DataAccessManager.ConstantDataAccessManager
extends DataAccessManager

This simple DataAccessManager restricts access for all managed elements to a single access level. It can used as a default manager to allow full write access or view only access to any DataSource.


Nested Class Summary
 
Nested classes inherited from class org.caleigo.core.DataAccessManager
DataAccessManager.ConstantDataAccessManager, DataAccessManager.IContentAccessVerifier
 
Field Summary
 
Fields inherited from class org.caleigo.core.DataAccessManager
CONTENT_BASED, NONE, READ, WRITE
 
Constructor Summary
DataAccessManager.ConstantDataAccessManager(int defaultAccessLevel)
           
 
Method Summary
 boolean acceptsReplacement(DataAccessManager newManager)
          This method allows a current manager to reject replacement by another DataAccessManager.
 int getAccessLevel(IDataSourceDescriptor dataSourceDescriptor)
          Returns the access level for the provided IDataSourceDescriptor defined as NONE, READ, WRITE or CONTENT_BASED.
 int getAccessLevel(IEntityAction entityAction)
          Returns the access level for the provided IEntityAction defined as NONE, READ, WRITE or CONTENT_BASED.
 int getAccessLevel(IEntityDescriptor entityDescriptor)
          Returns the access level for the provided IEntityDescriptor defined as NONE, READ, WRITE or CONTENT_BASED.
 int getAccessLevel(IFieldDescriptor fieldDescriptor)
          Returns the access level for the provided IFieldDescriptor defined as NONE, READ, WRITE or CONTENT_BASED.
 int getDefaultAccessLevel()
          Access method that returns the default accss level of the manager.
 boolean hasReadAccess(IDataSource dataSource)
          Returns true if the user has read access to the provided IDataSource.
 boolean hasReadAccess(IEntity entity)
          Returns true if the user has read access to the provided IEntity.
 boolean hasReadAccess(IEntityAction entityAction, IEntity data)
          Returns true if the user has read access to the provided IEntityAction object in the data content scope of the provided IEntity object.
 boolean hasReadAccess(IFieldDescriptor fieldDescriptor, IEntity data)
          Returns true if the user has read access to the provided fieldDescriptor in the data content scope of the provided IEntity object.
 boolean hasWriteAccess(IDataSource dataSource)
          Returns true if the user has write access to the provided IDataSource.
 boolean hasWriteAccess(IEntity entity)
          Returns true if the user has write access to the provided IEntity.
 boolean hasWriteAccess(IEntityAction entityAction, IEntity data)
          Returns true if the user has write access to the provided IEntityAction object in the data content scope of the provided IEntity object.
 boolean hasWriteAccess(IFieldDescriptor fieldDescriptor, IEntity data)
          Returns true if the user has write access to the provided fieldDescriptor in the data content scope of the provided IEntity object.
 
Methods inherited from class org.caleigo.core.DataAccessManager
getManager, setDefaultManager, setManager, setManagerReqursively
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataAccessManager.ConstantDataAccessManager

public DataAccessManager.ConstantDataAccessManager(int defaultAccessLevel)
Method Detail

getAccessLevel

public int getAccessLevel(IDataSourceDescriptor dataSourceDescriptor)
Returns the access level for the provided IDataSourceDescriptor defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.

Specified by:
getAccessLevel in class DataAccessManager

getAccessLevel

public int getAccessLevel(IEntityDescriptor entityDescriptor)
Returns the access level for the provided IEntityDescriptor defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.

Specified by:
getAccessLevel in class DataAccessManager

getAccessLevel

public int getAccessLevel(IFieldDescriptor fieldDescriptor)
Returns the access level for the provided IFieldDescriptor defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.

Specified by:
getAccessLevel in class DataAccessManager

getAccessLevel

public int getAccessLevel(IEntityAction entityAction)
Returns the access level for the provided IEntityAction defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.

Specified by:
getAccessLevel in class DataAccessManager

hasReadAccess

public boolean hasReadAccess(IDataSource dataSource)
Returns true if the user has read access to the provided IDataSource.

Specified by:
hasReadAccess in class DataAccessManager

hasReadAccess

public boolean hasReadAccess(IEntity entity)
Returns true if the user has read access to the provided IEntity.

Specified by:
hasReadAccess in class DataAccessManager

hasReadAccess

public boolean hasReadAccess(IFieldDescriptor fieldDescriptor,
                             IEntity data)
Returns true if the user has read access to the provided fieldDescriptor in the data content scope of the provided IEntity object.

Specified by:
hasReadAccess in class DataAccessManager

hasReadAccess

public boolean hasReadAccess(IEntityAction entityAction,
                             IEntity data)
Returns true if the user has read access to the provided IEntityAction object in the data content scope of the provided IEntity object.

Specified by:
hasReadAccess in class DataAccessManager

hasWriteAccess

public boolean hasWriteAccess(IDataSource dataSource)
Returns true if the user has write access to the provided IDataSource.

Specified by:
hasWriteAccess in class DataAccessManager

hasWriteAccess

public boolean hasWriteAccess(IEntity entity)
Returns true if the user has write access to the provided IEntity.

Specified by:
hasWriteAccess in class DataAccessManager

hasWriteAccess

public boolean hasWriteAccess(IFieldDescriptor fieldDescriptor,
                              IEntity data)
Returns true if the user has write access to the provided fieldDescriptor in the data content scope of the provided IEntity object.

Specified by:
hasWriteAccess in class DataAccessManager

hasWriteAccess

public boolean hasWriteAccess(IEntityAction entityAction,
                              IEntity data)
Returns true if the user has write access to the provided IEntityAction object in the data content scope of the provided IEntity object.

Specified by:
hasWriteAccess in class DataAccessManager

acceptsReplacement

public boolean acceptsReplacement(DataAccessManager newManager)
This method allows a current manager to reject replacement by another DataAccessManager.

Specified by:
acceptsReplacement in class DataAccessManager

getDefaultAccessLevel

public int getDefaultAccessLevel()
Access method that returns the default accss level of the manager.



Copyright © 2005 Caleigo. All Rights Reserved.