|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.RegisteredService atg.security.GenericUserAuthority atg.security.RepositoryApplicationUserAuthority
public class RepositoryApplicationUserAuthority
This LoginUserAuthority implements the bare minimum required to do logins and determine role memberships. It reads its data from a Repository, and must be configured with the names of the repository views and properties that it should use to obtain information such as login names, passwords, etc. It only reads from the Repository - it never writes.
The Persona objects generated by this UserAuthority represent only users, not groups or privileges. Personas are read only, and have no subPersonas or attributes. The only methods implemented for a Persona are getName (which returns the user's login), getUserAuthority, equals, and hasRole.
The repository is expected to contain a repository view representing the users, from which logins and passwords will be read. Presumably this repository view will contain more information about a user, but the UserAuthority only cares about those particular properties.
Optionally, the user's repository view may contain a "roles" property, which is consulted when Persona.hasRole is called. This property may be one of several types:
The following properties are used to configure all of the above:
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
RepositoryApplicationUserAuthority()
Constructor |
Method Summary | |
---|---|
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
PasswordHasher |
getPasswordHasher()
Returns the password hasher object used to encrypt password text to whatever format is required by login(). |
Persona |
getPersona(java.lang.Object pLoginName)
Returns a persona for the given login name. |
Repository |
getRepository()
|
java.lang.String |
getRoleViewRoleNameProperty()
|
javax.transaction.TransactionManager |
getTransactionManager()
|
java.lang.String |
getUserView()
|
java.lang.String |
getUserViewLoginProperty()
|
java.lang.String |
getUserViewPasswordProperty()
|
java.lang.String |
getUserViewRolesProperty()
|
boolean |
hasRole(RepositoryItem pUserItem,
java.lang.String pLoginName,
java.lang.String pRoleName)
Determine if the specified user's item has the specified role name. |
boolean |
hasRoleViewRoleNameProperty()
Returns true if RoleViewRoleNameProperty is specified, false if it is null or empty String |
boolean |
hasUserView()
Returns true if UserView is specified, false if it is null or empty String |
boolean |
hasUserViewLoginProperty()
Returns true if UserViewLoginProperty is specified, false if it is null or empty String |
boolean |
hasUserViewPasswordProperty()
Returns true if UserViewPasswordProperty is specified, false if it is null or empty String |
boolean |
hasUserViewRolesProperty()
Returns true if UserViewRolesProperty is specified, false if it is null or empty String |
boolean |
login(User pUser,
java.lang.String pName,
java.lang.String pPassword,
java.lang.Object pHashKey)
Authenticates a user, populating the User object with appropriate personae. |
void |
setPasswordHasher(PasswordHasher pPasswordHasher)
Sets the password hasher object used to encrypt password text to whatever format is required by login(). |
void |
setRepository(Repository pRepository)
|
void |
setRoleViewRoleNameProperty(java.lang.String pRoleViewRoleNameProperty)
|
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
|
void |
setUserView(java.lang.String pUserView)
|
void |
setUserViewLoginProperty(java.lang.String pUserViewLoginProperty)
|
void |
setUserViewPasswordProperty(java.lang.String pUserViewPasswordProperty)
|
void |
setUserViewRolesProperty(java.lang.String pUserViewRolesProperty)
|
Methods inherited from class atg.nucleus.RegisteredService |
---|
addToRegistry, getRegistry, getRegistryName, getServiceName, removeFromRegistry, setRegistryName, setServiceName, startService, stopService |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface atg.security.UserAuthority |
---|
addAuthenticationFailedListener, addAuthenticationSucceededListener, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, userDestroyed |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public RepositoryApplicationUserAuthority()
Method Detail |
---|
public Repository getRepository()
public void setRepository(Repository pRepository)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public java.lang.String getUserView()
public void setUserView(java.lang.String pUserView)
public java.lang.String getUserViewLoginProperty()
public void setUserViewLoginProperty(java.lang.String pUserViewLoginProperty)
public java.lang.String getUserViewPasswordProperty()
public void setUserViewPasswordProperty(java.lang.String pUserViewPasswordProperty)
public java.lang.String getUserViewRolesProperty()
public void setUserViewRolesProperty(java.lang.String pUserViewRolesProperty)
public java.lang.String getRoleViewRoleNameProperty()
public void setRoleViewRoleNameProperty(java.lang.String pRoleViewRoleNameProperty)
public boolean hasRole(RepositoryItem pUserItem, java.lang.String pLoginName, java.lang.String pRoleName)
public boolean hasUserView()
public boolean hasUserViewLoginProperty()
public boolean hasUserViewPasswordProperty()
public boolean hasUserViewRolesProperty()
public boolean hasRoleViewRoleNameProperty()
public Persona getPersona(java.lang.Object pLoginName)
getPersona
in interface UserAuthority
getPersona
in class GenericUserAuthority
public PasswordHasher getPasswordHasher()
getPasswordHasher
in interface LoginUserAuthority
public void setPasswordHasher(PasswordHasher pPasswordHasher)
public boolean login(User pUser, java.lang.String pName, java.lang.String pPassword, java.lang.Object pHashKey)
login
in interface LoginUserAuthority
PasswordHasher
public void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |