net.datacrow.core.security
Class SecuredUser

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

public final class SecuredUser
extends java.lang.Object

A secured user is a user which has logged on successfully.

Author:
Robert Jan van der Waals

Constructor Summary
protected SecuredUser(User user, java.lang.String password)
          Creates a new instance
 
Method Summary
 java.lang.String getPassword()
          The password of the user
 User getUser()
          Retrieves the underlying user.
 java.lang.String getUsername()
          The login name of the user
 boolean isAdmin()
          Indicates if the user is an administrator
 boolean isAuthorized(DcField field)
          Checks if the user is allowed to see the specified field
 boolean isAuthorized(DcModule module)
          Checks if the user is allowed to see the module
 boolean isAuthorized(Plugin plugin)
          Checks if the user is allowed to use the plugin.
 boolean isAuthorized(java.lang.String plugin)
          Checks if the user is allowed to use the plugin.
 boolean isEditingAllowed(DcField field)
          Indicates if the user is allowed to edit the specified field.
 boolean isEditingAllowed(DcModule module)
          Indicates if the user is allowed to edit items belonging to the module.
 void setPassword(java.lang.String password)
          Sets the password for this user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecuredUser

protected SecuredUser(User user,
                      java.lang.String password)
Creates a new instance

Parameters:
user - The user
password - An his / her password
Method Detail

getUser

public User getUser()
Retrieves the underlying user.


getUsername

public java.lang.String getUsername()
The login name of the user


getPassword

public java.lang.String getPassword()
The password of the user


isAdmin

public boolean isAdmin()
Indicates if the user is an administrator


isAuthorized

public boolean isAuthorized(DcField field)
Checks if the user is allowed to see the specified field

Parameters:
field - The to be checked field

isAuthorized

public boolean isAuthorized(DcModule module)
Checks if the user is allowed to see the module

Parameters:
module - The to be checked module

isEditingAllowed

public boolean isEditingAllowed(DcModule module)
Indicates if the user is allowed to edit items belonging to the module.

Parameters:
module - The to be checked module

isEditingAllowed

public boolean isEditingAllowed(DcField field)
Indicates if the user is allowed to edit the specified field.

Parameters:
field - The to be checked field

isAuthorized

public boolean isAuthorized(java.lang.String plugin)
Checks if the user is allowed to use the plugin.

Parameters:
plugin - The plugin key

setPassword

public void setPassword(java.lang.String password)
Sets the password for this user.

Parameters:
password -

isAuthorized

public boolean isAuthorized(Plugin plugin)
Checks if the user is allowed to use the plugin.

Parameters:
plugin -