atg.security
Class User

java.lang.Object
  extended by atg.security.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

The User object holds a collection of Personae that have been collected by one or more user authorities. This object is effectively a wallet into which identities are placed. It is possible for a User object to hold several different identities if a user has been authenticated by several different means.

See Also:
UserAuthority, Persona, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
User()
           
 
Method Summary
 void addPersona(Persona pNewPersona)
          Adds a new persona that has been granted to the user.
 void destroy()
          Destroys a user object.
 java.lang.Object doAs(Action pAction)
          Performs the specified action as this user.
 java.util.Collection getAccessRights()
          Returns true if this user has the indicated access right, either actual or implied.
 Persona[] getPersonae()
          Returns the set of personae granted to the user by various authorities.
 Persona[] getPersonae(UserAuthority pUserAuthority)
          Returns the set of personae granted to the user that were granted by the indicated authority.
 Persona getPrimaryPersona(UserAuthority pAuthority)
          Returns the primary persona for the user in a given user authority.
 UserAuthority[] getUserAuthorities()
          Returns the list of UserAuthorities associated with this User
 boolean hasAccessRight(AccessRight pAccessRight)
          Returns true if this user has the indicated access right, either actual or implied.
 boolean hasPersona(Persona pPersona)
          Returns true if this user has the indicated persona, either actual or implied.
 boolean hasRole(java.lang.String pRoleName, UserAuthority pAuthority)
          Returns true if the user has the given role within the given UserAuthority (security technology domain).
 boolean hasUserAuthority(UserAuthority pAuthority)
          Returns true if the indicated user authority is managing personae for this user.
 void removePersona(Persona pOldPersona)
          Removes a persona that has been granted to the user.
 void setPersonae(UserAuthority pUserAuthority, Persona[] pNewPersonae)
          Changes the set of personae assigned by a user authority.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

User

public User()
Method Detail

hasUserAuthority

public boolean hasUserAuthority(UserAuthority pAuthority)
Returns true if the indicated user authority is managing personae for this user.


hasPersona

public boolean hasPersona(Persona pPersona)
Returns true if this user has the indicated persona, either actual or implied.


hasAccessRight

public boolean hasAccessRight(AccessRight pAccessRight)
Returns true if this user has the indicated access right, either actual or implied.


getAccessRights

public java.util.Collection getAccessRights()
Returns true if this user has the indicated access right, either actual or implied.


getPrimaryPersona

public Persona getPrimaryPersona(UserAuthority pAuthority)
Returns the primary persona for the user in a given user authority.


getPersonae

public Persona[] getPersonae()
Returns the set of personae granted to the user by various authorities.


getPersonae

public Persona[] getPersonae(UserAuthority pUserAuthority)
Returns the set of personae granted to the user that were granted by the indicated authority.


addPersona

public void addPersona(Persona pNewPersona)
Adds a new persona that has been granted to the user.


removePersona

public void removePersona(Persona pOldPersona)
Removes a persona that has been granted to the user.


setPersonae

public void setPersonae(UserAuthority pUserAuthority,
                        Persona[] pNewPersonae)
                 throws InvalidPersonaException
Changes the set of personae assigned by a user authority. If a null set of personae is supplied, this user is marked as being managed by the user authority without any assigned personae.

Throws:
InvalidPersonaException

doAs

public java.lang.Object doAs(Action pAction)
                      throws java.lang.Exception
Performs the specified action as this user.

Throws:
java.lang.Exception
See Also:
ThreadSecurityManager.doAs(atg.security.User, atg.security.Action), Action.run()

destroy

public void destroy()
Destroys a user object. This notifies all authenticators of the destruction of the user object.


hasRole

public boolean hasRole(java.lang.String pRoleName,
                       UserAuthority pAuthority)
Returns true if the user has the given role within the given UserAuthority (security technology domain).


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getUserAuthorities

public UserAuthority[] getUserAuthorities()
Returns the list of UserAuthorities associated with this User