Package org.jboss.security
Class RunAsIdentity
- java.lang.Object
-
- org.jboss.security.SimplePrincipal
-
- org.jboss.security.RunAsIdentity
-
- All Implemented Interfaces:
Serializable,Cloneable,Principal,RunAs
public class RunAsIdentity extends SimplePrincipal implements Cloneable, RunAs
The RunAsIdentity is a Principal that associates the run-as principal with his run-as role(s).- Version:
- $Revision$
- Author:
- Thomas.Diesler@jboss.org, Scott.Stark@jboss.org, Anil.Saldhana@jboss.org
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RunAsIdentity(String roleName, String principalName)Construct an inmutable instance of a RunAsIdentityRunAsIdentity(String roleName, String principalName, Set<String> extraRoleNames)Construct an inmutable instance of a RunAsIdentity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()booleandoesUserHaveRole(Principal role)booleandoesUserHaveRole(Set<Principal> methodRoles)True if the run-as principal has any of the method roles<T> TgetIdentity()Return the identity representedSet<Principal>getPrincipalsSet()Return a set with the configured run-as principal and a Group("Roles") with the run-as roles<T> TgetProof()Return the proof of identitySet<Principal>getRunAsRoles()Return a set with the configured run-as roleRoleGroupgetRunAsRolesAsRoleGroup()Return a RoleGroup of Run-As rolesStringtoString()Returns a string representation of the object.-
Methods inherited from class org.jboss.security.SimplePrincipal
equals, getName, hashCode
-
-
-
-
Method Detail
-
getRunAsRoles
public Set<Principal> getRunAsRoles()
Return a set with the configured run-as role- Returns:
- Set
for the run-as roles
-
getRunAsRolesAsRoleGroup
public RoleGroup getRunAsRolesAsRoleGroup()
Return a RoleGroup of Run-As roles- Returns:
-
getPrincipalsSet
public Set<Principal> getPrincipalsSet()
Return a set with the configured run-as principal and a Group("Roles") with the run-as roles- Returns:
- Set
for the run-as principal and roles
-
doesUserHaveRole
public boolean doesUserHaveRole(Principal role)
-
doesUserHaveRole
public boolean doesUserHaveRole(Set<Principal> 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:
toStringin interfacePrincipal- Overrides:
toStringin classSimplePrincipal- Returns:
- a string representation of the object.
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getIdentity
public <T> T getIdentity()
Description copied from interface:RunAsReturn the identity represented- Specified by:
getIdentityin interfaceRunAs- Returns:
-
-