org.jboss.security
Class RunAsIdentity

java.lang.Object
  extended by org.jboss.security.SimplePrincipal
      extended by org.jboss.security.CallerIdentity
          extended by org.jboss.security.RunAsIdentity
All Implemented Interfaces:
Serializable, Principal

public class RunAsIdentity
extends CallerIdentity

The RunAsIdentity is a Principal that associates the run-as principal with his run-as role(s).

Version:
$Revision: 1.5 $
Author:
Thomas.Diesler@jboss.org
See Also:
Serialized Form

Constructor Summary
RunAsIdentity(String roleName, String principalName)
          Construct an inmutable instance of a RunAsIdentity
RunAsIdentity(String roleName, String principalName, Set extraRoleNames)
          Construct an inmutable instance of a RunAsIdentity
 
Method Summary
 boolean doesUserHaveRole(Principal role)
           
 boolean doesUserHaveRole(Set methodRoles)
          True if the run-as principal has any of the method roles
 Set getRunAsRoles()
           
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jboss.security.CallerIdentity
equals, getCredential, hashCode
 
Methods inherited from class org.jboss.security.SimplePrincipal
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunAsIdentity

public RunAsIdentity(String roleName,
                     String principalName)
Construct an inmutable instance of a RunAsIdentity


RunAsIdentity

public RunAsIdentity(String roleName,
                     String principalName,
                     Set extraRoleNames)
Construct an inmutable instance of a RunAsIdentity

Method Detail

getRunAsRoles

public Set getRunAsRoles()

doesUserHaveRole

public boolean doesUserHaveRole(Principal role)

doesUserHaveRole

public boolean doesUserHaveRole(Set methodRoles)
True if the run-as principal has any of the method roles


toString

public String toString()
Returns a string representation of the object.

Specified by:
toString in interface Principal
Overrides:
toString in class CallerIdentity
Returns:
a string representation of the object.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.