public class JAASUserPrincipal
extends java.lang.Object
implements java.security.Principal
Implements the JAAS version of the org.mortbay.http.UserPrincipal interface.
Modifier and Type | Class and Description |
---|---|
static class |
JAASUserPrincipal.RoleStack
RoleStack
|
Constructor and Description |
---|
JAASUserPrincipal(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
disassociate()
Clean out any pushed roles that haven't been popped
|
java.lang.String |
getName()
Get the name identifying the user
|
java.security.acl.Group |
getRoles()
Determine the roles that the LoginModule has set
|
javax.security.auth.Subject |
getSubject()
Provide access to the current Subject
|
boolean |
isUserInRole(java.lang.String roleName)
Check if user is in role
|
void |
popRole()
Remove temporary association between user and role.
|
void |
pushRole(java.lang.String roleName)
Temporarily associate a user with a role.
|
void |
setRoleCheckPolicy(RoleCheckPolicy policy)
Set the type of checking for isUserInRole
|
protected void |
setSubject(javax.security.auth.Subject subject)
Sets the JAAS subject for this user.
|
public JAASUserPrincipal(java.lang.String name)
name
- the name identifying the userpublic boolean isUserInRole(java.lang.String roleName)
roleName
- role to checkpublic java.security.acl.Group getRoles()
public void setRoleCheckPolicy(RoleCheckPolicy policy)
policy
- public void pushRole(java.lang.String roleName)
roleName
- public void popRole()
public void disassociate()
public java.lang.String getName()
getName
in interface java.security.Principal
protected void setSubject(javax.security.auth.Subject subject)
subject
- public javax.security.auth.Subject getSubject()
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.