deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.security.drm.model
Class User

java.lang.Object
  extended by org.deegree.security.drm.model.SecurableObject
      extended by org.deegree.security.drm.model.User

public class User
extends SecurableObject

Implementation of user-objects. User s can be members of Groups and can be associated with Roles.

A user is always in one of two states:

Version:
$Revision: 18195 $, $Date: 21.08.2007 16:51:15$
Author:
Markus Schneider, last edited by: $Author: mays$

Field Summary
static int ID_SEC_ADMIN
           
 
Fields inherited from class org.deegree.security.drm.model.SecurableObject
id, name, registry, title, type
 
Constructor Summary
User(int id, String name, String password, String firstName, String lastName, String emailAddress, SecurityRegistry registry)
          Creates a new User -instance.
 
Method Summary
 void authenticate(String password)
          Checks if the submitted password is equal to the one of this user instance and sets the state to "authenticated" in case it is correct.
 String getEmailAddress()
           
 String getFirstName()
           
 Group[] getGroups(SecurityAccess securityAccess)
          Returns the groups that this user belongs to.
 String getLastName()
           
 String getPassword()
           
 Privilege[] getPrivileges(SecurityAccess securityAccess)
          Returns the Privileges that the User has (directly and via group memberships).
 RightSet getRights(SecurityAccess securityAccess, SecurableObject object)
          Returns the rights that this User has on the given SecurableObject (directly and via group memberships).
 Role[] getRoles(SecurityAccess securityAccess)
          Returns the roles that this is user is associated with (directly and via group memberships).
 boolean hasPrivilege(SecurityAccess securityAccess, Privilege privilege)
          Returns whether the User has a certain Privilege (either directly or via group memberships).
 boolean hasPrivilege(SecurityAccess securityAccess, String s)
          Returns whether the User has a certain privilege (either directly or via group memberships).
 boolean hasRight(SecurityAccess securityAccess, RightType type, Feature accessParams, SecurableObject object)
          Returns whether the User has a certain Right on this SecurableObject (directly or via group memberships).
 boolean hasRight(SecurityAccess securityAccess, RightType type, SecurableObject object)
          Returns whether the User has a certain Right on this SecurableObject (directly or via group memberships).
 boolean hasRight(SecurityAccess securityAccess, String s, SecurableObject object)
          Returns whether the User has a certain right on this SecurableObject (directly or via group memberships).
 boolean isAuthenticated()
          Returns whether the User has already been authenticated by a call to authenticate() with the correct password (or if the user's password is null).
 String toString(SecurityAccess securityAccess)
          Returns a String representation of this object.
 
Methods inherited from class org.deegree.security.drm.model.SecurableObject
equals, getID, getName, getTitle, getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_SEC_ADMIN

public static final int ID_SEC_ADMIN
See Also:
Constant Field Values
Constructor Detail

User

public User(int id,
            String name,
            String password,
            String firstName,
            String lastName,
            String emailAddress,
            SecurityRegistry registry)
Creates a new User -instance.

Parameters:
id -
name -
password - null means that password checking is disabled
firstName -
lastName -
emailAddress -
registry -
Method Detail

getFirstName

public String getFirstName()
Returns:
the first name

getLastName

public String getLastName()
Returns:
the last name

getEmailAddress

public String getEmailAddress()
Returns:
the mail address

getPassword

public String getPassword()
Returns:
the password

getGroups

public Group[] getGroups(SecurityAccess securityAccess)
                  throws GeneralSecurityException
Returns the groups that this user belongs to.

Parameters:
securityAccess -
Returns:
the user's groups
Throws:
GeneralSecurityException

getRoles

public Role[] getRoles(SecurityAccess securityAccess)
                throws GeneralSecurityException
Returns the roles that this is user is associated with (directly and via group memberships).

Parameters:
securityAccess -
Returns:
the user's roles
Throws:
GeneralSecurityException

getPrivileges

public Privilege[] getPrivileges(SecurityAccess securityAccess)
                          throws GeneralSecurityException
Returns the Privileges that the User has (directly and via group memberships).

Parameters:
securityAccess -
Returns:
the user's privileges
Throws:
GeneralSecurityException

hasPrivilege

public boolean hasPrivilege(SecurityAccess securityAccess,
                            Privilege privilege)
                     throws GeneralSecurityException
Returns whether the User has a certain Privilege (either directly or via group memberships).

Parameters:
securityAccess -
privilege -
Returns:
true if the user has the specified privilege
Throws:
GeneralSecurityException

hasPrivilege

public boolean hasPrivilege(SecurityAccess securityAccess,
                            String s)
                     throws GeneralSecurityException
Returns whether the User has a certain privilege (either directly or via group memberships).

Parameters:
securityAccess -
s -
Returns:
true if the user has the specified privilege
Throws:
GeneralSecurityException

getRights

public RightSet getRights(SecurityAccess securityAccess,
                          SecurableObject object)
                   throws GeneralSecurityException
Returns the rights that this User has on the given SecurableObject (directly and via group memberships).

Parameters:
securityAccess -
object -
Returns:
the user's right for the specified object
Throws:
GeneralSecurityException

hasRight

public boolean hasRight(SecurityAccess securityAccess,
                        RightType type,
                        Feature accessParams,
                        SecurableObject object)
                 throws GeneralSecurityException
Returns whether the User has a certain Right on this SecurableObject (directly or via group memberships).

Parameters:
securityAccess -
type -
accessParams -
object -
Returns:
true if the user has the right for the specified object
Throws:
GeneralSecurityException

hasRight

public boolean hasRight(SecurityAccess securityAccess,
                        RightType type,
                        SecurableObject object)
                 throws GeneralSecurityException
Returns whether the User has a certain Right on this SecurableObject (directly or via group memberships).

Parameters:
securityAccess -
type -
object -
Returns:
true if the user has the right for the specified object
Throws:
GeneralSecurityException

hasRight

public boolean hasRight(SecurityAccess securityAccess,
                        String s,
                        SecurableObject object)
                 throws GeneralSecurityException
Returns whether the User has a certain right on this SecurableObject (directly or via group memberships).

Parameters:
securityAccess -
s -
object -
Returns:
true if the user has the right for the specified object
Throws:
GeneralSecurityException

isAuthenticated

public boolean isAuthenticated()
Returns whether the User has already been authenticated by a call to authenticate() with the correct password (or if the user's password is null).

Returns:
true, if the user is authenticated

toString

public String toString(SecurityAccess securityAccess)
Returns a String representation of this object.

Parameters:
securityAccess -
Returns:
the object as string

authenticate

public void authenticate(String password)
                  throws WrongCredentialsException
Checks if the submitted password is equal to the one of this user instance and sets the state to "authenticated" in case it is correct.

Parameters:
password -
Throws:
WrongCredentialsException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org