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 Object
clone()
boolean
doesUserHaveRole(Principal role)
boolean
doesUserHaveRole(Set<Principal> methodRoles)
True if the run-as principal has any of the method roles<T> T
getIdentity()
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> T
getProof()
Return the proof of identitySet<Principal>
getRunAsRoles()
Return a set with the configured run-as roleRoleGroup
getRunAsRolesAsRoleGroup()
Return a RoleGroup of Run-As rolesString
toString()
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:
toString
in interfacePrincipal
- Overrides:
toString
in classSimplePrincipal
- Returns:
- a string representation of the object.
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getIdentity
public <T> T getIdentity()
Description copied from interface:RunAs
Return the identity represented- Specified by:
getIdentity
in interfaceRunAs
- Returns:
-
-