|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.seam.core.AbstractMutable org.jboss.seam.core.Selector org.jboss.seam.security.Identity
@Name(value="org.jboss.seam.security.identity") @Scope(value=SESSION) @Install(precedence=0) @Intercept(value=NEVER) @Startup public class Identity
Field Summary | |
---|---|
static String |
ROLES_GROUP
|
Constructor Summary | |
---|---|
Identity()
|
Method Summary | |
---|---|
protected void |
addLoginFailedMessage(LoginException ex)
|
protected void |
addLoginSuccessfulMessage()
|
boolean |
addRole(String role)
Adds a role to the user's subject, and their security context |
void |
authenticate()
|
void |
authenticate(LoginContext loginContext)
|
void |
checkEntityPermission(Object entity,
EntityAction action)
|
void |
checkPermission(String name,
String action,
Object... arg)
Assert that the current authenticated Identity has permission for the specified name and action |
void |
checkRestriction(String expr)
Performs an authorization check, based on the specified security expression. |
void |
checkRole(String role)
Assert that the current authenticated Identity is a member of the specified role. |
void |
create()
|
protected boolean |
evaluateExpression(String expr)
Evaluates the specified security expression, which must return a boolean value. |
Expressions.MethodBinding |
getAuthenticateMethod()
|
protected String |
getCookieName()
Override to define the cookie name |
protected CallbackHandler |
getDefaultCallbackHandler()
Creates a callback handler that can handle a standard username/password callback, using the username and password properties. |
String |
getJaasConfigName()
|
protected LoginContext |
getLoginContext()
|
protected String |
getLoginFailedMessage()
|
protected String |
getLoginFailedMessageKey()
|
protected javax.faces.application.FacesMessage.Severity |
getLoginFailedMessageSeverity()
|
protected String |
getLoginSuccessfulMessage()
|
protected String |
getLoginSuccessfulMessageKey()
|
protected javax.faces.application.FacesMessage.Severity |
getLoginSuccessfulMessageSeverity()
|
String |
getPassword()
|
Principal |
getPrincipal()
|
Subject |
getSubject()
|
String |
getUsername()
|
boolean |
hasPermission(String name,
String action,
Object... arg)
Performs a permission check for the specified name and action |
boolean |
hasRole(String role)
Checks if the authenticated Identity is a member of the specified role. |
static Identity |
instance()
|
boolean |
isLoggedIn()
If there is a principal set, then the user is logged in. |
boolean |
isRememberMe()
|
String |
login()
|
void |
logout()
|
protected void |
postAuthenticate()
|
protected void |
postRememberMe()
|
protected void |
preAuthenticate()
|
void |
removeRole(String role)
Removes a role from the user's subject and their security context |
void |
setAuthenticateMethod(Expressions.MethodBinding authMethod)
|
void |
setJaasConfigName(String jaasConfigName)
|
void |
setPassword(String password)
|
void |
setRememberMe(boolean remember)
|
void |
setUsername(String username)
|
protected void |
unAuthenticate()
Removes all Role objects from the security context, removes the "Roles" group from the user's subject. |
Methods inherited from class org.jboss.seam.core.Selector |
---|
clearCookieValue, getCookie, getCookieMaxAge, getCookieValue, getCookieValueIfEnabled, isCookieEnabled, setCookieEnabled, setCookieMaxAge, setCookieValueIfEnabled |
Methods inherited from class org.jboss.seam.core.AbstractMutable |
---|
clearDirty, setDirty, setDirty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ROLES_GROUP
Constructor Detail |
---|
public Identity()
Method Detail |
---|
protected String getCookieName()
Selector
getCookieName
in class Selector
@Create public void create()
protected void postRememberMe()
public static Identity instance()
public boolean isLoggedIn()
public Principal getPrincipal()
public Subject getSubject()
public void checkRestriction(String expr)
expr
- The security expression to evaluate
NotLoggedInException
- Thrown if the authorization check fails and
the user is not authenticated
AuthorizationException
- Thrown if the authorization check fails and
the user is authenticatedpublic String login()
protected void addLoginFailedMessage(LoginException ex)
protected String getLoginFailedMessage()
protected javax.faces.application.FacesMessage.Severity getLoginFailedMessageSeverity()
protected String getLoginFailedMessageKey()
protected void addLoginSuccessfulMessage()
protected javax.faces.application.FacesMessage.Severity getLoginSuccessfulMessageSeverity()
protected String getLoginSuccessfulMessage()
protected String getLoginSuccessfulMessageKey()
public void authenticate() throws LoginException
LoginException
public void authenticate(LoginContext loginContext) throws LoginException
LoginException
protected void preAuthenticate()
protected void postAuthenticate()
protected void unAuthenticate()
protected LoginContext getLoginContext() throws LoginException
LoginException
public void logout()
public boolean hasRole(String role)
role
- String The name of the role to check
public boolean addRole(String role)
role
- The name of the role to addpublic void removeRole(String role)
role
- The name of the role to removepublic void checkRole(String role)
role
- String The name of the role to check
AuthorizationException
- if not a memberpublic void checkPermission(String name, String action, Object... arg)
name
- String The permission nameaction
- String The permission actionarg
- Object Optional object parameter used to make a permission decision
AuthorizationException
- if the user does not have the specified permissionpublic boolean hasPermission(String name, String action, Object... arg)
name
- String The permission nameaction
- String The permission actionarg
- Object Optional object parameter used to make a permission decision
protected CallbackHandler getDefaultCallbackHandler()
protected boolean evaluateExpression(String expr)
expr
- String The expression to evaluate
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public Expressions.MethodBinding getAuthenticateMethod()
public void setAuthenticateMethod(Expressions.MethodBinding authMethod)
public boolean isRememberMe()
public void setRememberMe(boolean remember)
public String getJaasConfigName()
public void setJaasConfigName(String jaasConfigName)
public void checkEntityPermission(Object entity, EntityAction action)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |