org.mortbay.jaas

Class JAASUserPrincipal

public class JAASUserPrincipal extends Object implements Principal

JAASUserPrincipal

Implements the JAAS version of the org.mortbay.http.UserPrincipal interface.

Version: $Id: JAASUserPrincipal.java,v 1.6 2004/07/01 19:12:08 janb Exp $

Author: Jan Bartel (janb)

Nested Class Summary
static classJAASUserPrincipal.RoleStack
RoleStack

Constructor Summary
JAASUserPrincipal(String name)
Constructor.
Method Summary
voiddisassociate()
Clean out any pushed roles that haven't been popped
StringgetName()
Get the name identifying the user
GroupgetRoles()
Determine the roles that the LoginModule has set
SubjectgetSubject()
Provide access to the current Subject
booleanisUserInRole(String roleName)
Check if user is in role
voidpopRole()
Remove temporary association between user and role.
voidpushRole(String roleName)
Temporarily associate a user with a role.
voidsetRoleCheckPolicy(RoleCheckPolicy policy)
Set the type of checking for isUserInRole
protected voidsetSubject(Subject subject)
Sets the JAAS subject for this user.

Constructor Detail

JAASUserPrincipal

public JAASUserPrincipal(String name)
Constructor.

Parameters: name the name identifying the user

Method Detail

disassociate

public void disassociate()
Clean out any pushed roles that haven't been popped

getName

public String getName()
Get the name identifying the user

Returns:

getRoles

public Group getRoles()
Determine the roles that the LoginModule has set

Returns:

getSubject

public Subject getSubject()
Provide access to the current Subject

Returns:

isUserInRole

public boolean isUserInRole(String roleName)
Check if user is in role

Parameters: roleName role to check

Returns: true or false accordint to the RoleCheckPolicy.

popRole

public void popRole()
Remove temporary association between user and role.

pushRole

public void pushRole(String roleName)
Temporarily associate a user with a role.

Parameters: roleName

setRoleCheckPolicy

public void setRoleCheckPolicy(RoleCheckPolicy policy)
Set the type of checking for isUserInRole

Parameters: policy

setSubject

protected void setSubject(Subject subject)
Sets the JAAS subject for this user. The subject contains:
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.