public class SecurityContext
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkUserInRole(java.lang.String[] roleSet)
Returns true if the user principal is in the specified role.
|
static SecurityContextProvider |
getProvider()
Gets the provider for the current thread.
|
static java.security.Principal |
getUserPrincipal()
Returns the principal for this security context.
|
static boolean |
isTransportSecure()
Returns true if the context is secure (SSL).
|
static boolean |
isUserInRole(java.lang.String roleName)
Returns true if the user principal is in the specified role.
|
static boolean |
isUserInRole(java.lang.String[] roleSet)
Returns true if the user principal is in the specified role.
|
static java.lang.String |
runAs(java.lang.String role)
Returns true if the user principal is in the specified role.
|
public static java.security.Principal getUserPrincipal()
throws SecurityContextException
SecurityContextExceptionpublic static boolean isUserInRole(java.lang.String roleName)
roleName - the name of the role to test.public static boolean isUserInRole(java.lang.String[] roleSet)
roleSet - a set of roles to test.public static void checkUserInRole(java.lang.String[] roleSet)
roleSet - a set of roles to test.public static java.lang.String runAs(java.lang.String role)
roleSet - a set of roles to test.public static boolean isTransportSecure()
throws SecurityContextException
SecurityContextExceptionpublic static SecurityContextProvider getProvider()