站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss Seam 1.1.5 API 英文版文档

Identity (JBoss Seam API Documentation) - JBoss Seam 1.1.5 API 英文版文档


org.jboss.seam.security
Class Identity

java.lang.Object
  extended by org.jboss.seam.security.Identity
All Implemented Interfaces:
Serializable

@Name(value="org.jboss.seam.security.identity")
@Scope(value=SESSION)
@Install(precedence=0,
         classDependencies="org.drools.WorkingMemory")
@Intercept(value=NEVER)
public class Identity
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  Principal principal
           
protected  Subject subject
           
 
Constructor Summary
Identity()
           
 
Method Summary
 void authenticate()
           
 void authenticate(LoginContext loginContext)
           
 void checkRestriction(String expr)
          Performs an authorization check, based on the specified security expression.
 void create()
           
protected  boolean evaluateExpression(String expr)
          Evaluates the specified security expression, which must return a boolean value.
 Expressions.MethodBinding getAuthenticateMethod()
           
protected  CallbackHandler getCallbackHandler(String username, String password)
          Creates a callback handler that can handle a standard username/password callback, using the specified username and password parameters.
protected  Configuration getConfiguration()
           
protected  LoginContext getLoginContext()
           
 String getPassword()
           
 Principal getPrincipal()
           
 org.drools.WorkingMemory getSecurityContext()
           
 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.
 String login()
           
 void logout()
           
protected  void postAuthenticate()
          Populates the specified subject's roles with any inherited roles according to the role memberships contained within the current SecurityConfiguration
 void setAuthenticateMethod(Expressions.MethodBinding authMethod)
           
 void setPassword(String password)
           
 void setUsername(String username)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

principal

protected Principal principal

subject

protected Subject subject
Constructor Detail

Identity

public Identity()
Method Detail

create

@Create
public void create()

instance

public static Identity instance()

isLoggedIn

public boolean isLoggedIn()
If there is a principal set, then the user is logged in.


getPrincipal

public Principal getPrincipal()

getSubject

public Subject getSubject()

checkRestriction

public void checkRestriction(String expr)
Performs an authorization check, based on the specified security expression.

Parameters:
expr - The security expression to evaluate
Throws:
NotLoggedInException - Thrown if the authorization check fails and the user is not authenticated
AuthorizationException - Thrown if the authorization check fails and the user is authenticated

login

public String login()

authenticate

public void authenticate()
                  throws LoginException
Throws:
LoginException

authenticate

public void authenticate(LoginContext loginContext)
                  throws LoginException
Throws:
LoginException

getLoginContext

protected LoginContext getLoginContext()
                                throws LoginException
Throws:
LoginException

logout

public void logout()

hasRole

public boolean hasRole(String role)
Checks if the authenticated Identity is a member of the specified role.

Parameters:
role - String The name of the role to check
Returns:
boolean True if the user is a member of the specified role

hasPermission

public boolean hasPermission(String name,
                             String action,
                             Object... arg)
Performs a permission check for the specified name and action

Parameters:
name - String The permission name
action - String The permission action
arg - Object Optional object parameter used to make a permission decision
Returns:
boolean True if the user has the specified permission

getCallbackHandler

protected CallbackHandler getCallbackHandler(String username,
                                             String password)
Creates a callback handler that can handle a standard username/password callback, using the specified username and password parameters.

Parameters:
username - The username to provide for a NameCallback
password - The password to provide for a PasswordCallback

getConfiguration

protected Configuration getConfiguration()

postAuthenticate

protected void postAuthenticate()
Populates the specified subject's roles with any inherited roles according to the role memberships contained within the current SecurityConfiguration


evaluateExpression

protected boolean evaluateExpression(String expr)
Evaluates the specified security expression, which must return a boolean value.

Parameters:
expr - String The expression to evaluate
Returns:
boolean The result of the expression evaluation

getUsername

public String getUsername()

setUsername

public void setUsername(String username)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getSecurityContext

public org.drools.WorkingMemory getSecurityContext()

getAuthenticateMethod

public Expressions.MethodBinding getAuthenticateMethod()

setAuthenticateMethod

public void setAuthenticateMethod(Expressions.MethodBinding authMethod)