当前页面:
在线文档首页 >
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
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
principal
protected Principal principal
subject
protected Subject subject
Identity
public Identity()
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