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

Identity (JBoss Seam API Documentation) - JBoss Seam 1.1.1 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,
         dependencies="org.jboss.seam.securityManager")
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 checkRestriction(String expr)
          Performs an authorization check, based on the specified security expression.
 Principal getPrincipal()
           
 Subject getSubject()
           
static Identity instance()
           
 boolean isLoggedIn()
          If there is a principal set, then the user is logged in.
 boolean isUserInRole(String role)
          Checks if the authenticated user contains the specified role.
 
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

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()

isUserInRole

public boolean isUserInRole(String role)
Checks if the authenticated user contains the specified role.

Parameters:
role - String
Returns:
boolean Returns true if the authenticated user contains the role, or false if otherwise.

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 user is not authenticated
AuthorizationException - if the authorization check fails