|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.chwf.plugin.User
An abstract superclass for custom user information. This plugin class
can be used to define custom authentication mechanisms for the Chrysalis
framework. Unlike most plugins, the User
plugin is a
per-user singleton rather than a global singleton.
Field Summary | |
static java.lang.String |
AUTHENTICATED
Special role requiring only authentication. |
static java.lang.String |
REDIRECT_PARAMETER
Parameter that stores post-login redirects. |
Constructor Summary | |
protected |
User()
No-op constructor. |
Method Summary | |
abstract void |
check(java.lang.String[] roles)
Method that checks roles user roles. |
abstract java.lang.String |
getAuthType()
A string name for the authentication mechanism. |
static User |
getInstance()
Returns the current User object. |
abstract java.lang.String |
getUserID()
Retrieve the user ID (if available) used to log in this user. |
abstract boolean |
isAuthenticated()
True if the user has logged in. |
abstract boolean |
isInRole(java.lang.String role)
True if the user is in the specified role. |
abstract void |
logout()
Log the user out. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String AUTHENTICATED
public static final java.lang.String REDIRECT_PARAMETER
Constructor Detail |
protected User()
Method Detail |
public static User getInstance() throws RegistryException
User
object. This object will contain
no information if no user is currently logged in. Any custom login
operation should populate the User
object with appropriate
authentication data.RegistryException
- If the user class cannot be initialized.public abstract java.lang.String getUserID()
null
if not logged in.public abstract boolean isInRole(java.lang.String role)
role
- The role.public abstract boolean isAuthenticated()
public abstract java.lang.String getAuthType()
null
if not logged in.public abstract void logout()
public abstract void check(java.lang.String[] roles) throws AuthenticationException
Method that checks roles user roles. This method should throw
a SecurityException
if the user's role is invalid.
roles
- The expected security roles.AuthenticationException
- With error message for security failure.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |