atg.security
Interface Persona

All Superinterfaces:
java.security.Principal
All Known Subinterfaces:
DefaultGroupPersona, GroupPersona, LoginPersona
All Known Implementing Classes:
AliasedPersona, EveryonePersona, GenericDefaultGroupPersona, GenericGroupPersona, GenericLoginPersona, GenericPersona, PersonaAdapter, RepositoryApplicationPersona

public interface Persona
extends java.security.Principal

An identity, either of a user or of a user's role. Persona objects may have multiple embedded identities, for instance a user may have several roles (e.g. manager and developer).

The Persona interface is a superset of the standard J2EE Principal interface, and implements the Principle interface for interoperability.

See Also:
User, UserAuthority, AccessControlEntry

Field Summary
static java.lang.String CLASS_VERSION
           
 
Method Summary
 void addSubPersona(Persona newSubPersona)
          Adds a new sub-persona.
 boolean equals(java.lang.Object object)
          Returns true if this persona is equivalent to another.
 java.util.Collection getAccessRights()
          Returns the access rights associated with the principal
 java.lang.Object getAttribute(java.lang.String attributeName)
          Retrieves the value of a named attribute of the persona's account.
 java.lang.String getName()
          Returns the machine-readable name of the persona, useful for persisting the object.
 Persona[] getSubPersonae()
          Returns a list of sub-personae that compose this persona.
 UserAuthority getUserAuthority()
          Returns the authority that manages this persona.
 boolean hasPersona(Persona persona)
          Returns true if this persona matches or encompasses the indicated persona.
 boolean hasRole(java.lang.String roleName)
          Returns true if this persona is or has a sub-persona with the given name.
 void removeSubPersona(Persona oldPersona)
          Removes a sub-persona.
 void setSubPersonae(Persona[] newSubPersonae)
          Changes the list of sub-personae that compose this persona.
 
Methods inherited from interface java.security.Principal
hashCode, toString
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns the machine-readable name of the persona, useful for persisting the object.

Specified by:
getName in interface java.security.Principal

getUserAuthority

UserAuthority getUserAuthority()
Returns the authority that manages this persona.


equals

boolean equals(java.lang.Object object)
Returns true if this persona is equivalent to another.

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object

hasPersona

boolean hasPersona(Persona persona)
Returns true if this persona matches or encompasses the indicated persona.


getSubPersonae

Persona[] getSubPersonae()
Returns a list of sub-personae that compose this persona.


setSubPersonae

void setSubPersonae(Persona[] newSubPersonae)
                    throws InvalidPersonaException
Changes the list of sub-personae that compose this persona.

Throws:
InvalidPersonaException

addSubPersona

void addSubPersona(Persona newSubPersona)
                   throws InvalidPersonaException
Adds a new sub-persona.

Throws:
InvalidPersonaException

removeSubPersona

void removeSubPersona(Persona oldPersona)
                      throws InvalidPersonaException
Removes a sub-persona.

Throws:
InvalidPersonaException

getAttribute

java.lang.Object getAttribute(java.lang.String attributeName)
Retrieves the value of a named attribute of the persona's account. This is a general escape hatch for passing information between the account database and the security domain and is primarily used to allow the security domain to determine the default ACL to use when creating secured resources.

See Also:
SecurityDomain.createResource(java.lang.Object, java.lang.Object, atg.security.AccessControlEntry[])

hasRole

boolean hasRole(java.lang.String roleName)
Returns true if this persona is or has a sub-persona with the given name.


getAccessRights

java.util.Collection getAccessRights()
Returns the access rights associated with the principal