net.datacrow.core.security
Class ModulePermission

java.lang.Object
  extended by net.datacrow.core.security.ModulePermission

public final class ModulePermission
extends java.lang.Object

Indicates which permissions the user has for a specific module.

Author:
Robert Jan van der Waals

Constructor Summary
protected ModulePermission(int moduleIdx)
          Creates a new instance
 
Method Summary
 void addPermission(Permission field)
          Sets the permission for a specific field
 int getModuleIdx()
          The module index.
 Permission getPermision(int fieldIdx)
           
 boolean isAuthorized()
          Checks if the user is allowed to see the module.
 boolean isAuthorized(DcField field)
          Indicates if the user is authorized to view the field.
 boolean isEditingAllowed()
          Checks if the user is allowed to make changes to items belonging to the module.
 void setModuleIdx(int moduleIdx)
          Sets the module index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModulePermission

protected ModulePermission(int moduleIdx)
Creates a new instance

Parameters:
moduleIdx -
Method Detail

getModuleIdx

public final int getModuleIdx()
The module index.


setModuleIdx

public final void setModuleIdx(int moduleIdx)
Sets the module index

Parameters:
moduleIdx - Module index

getPermision

public final Permission getPermision(int fieldIdx)

addPermission

public final void addPermission(Permission field)
Sets the permission for a specific field

Parameters:
field -

isAuthorized

public final boolean isAuthorized(DcField field)
Indicates if the user is authorized to view the field.

Parameters:
field -

isAuthorized

public final boolean isAuthorized()
Checks if the user is allowed to see the module. The check is actually based on the field permissions. If the user is not allowed to view any of the fields the user will not have access to the module.


isEditingAllowed

public final boolean isEditingAllowed()
Checks if the user is allowed to make changes to items belonging to the module. The check is actually based on the field permissions. If the user is not allowed to edit any of the fields the user will not have write access to the module.