com.caucho.security
Class SecurityContext
java.lang.Object
|
+--com.caucho.security.SecurityContext
- public class SecurityContext
- extends java.lang.Object
Defines a proxy for the current security context.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getUserPrincipal
public static java.security.Principal getUserPrincipal()
throws SecurityContextException
- Returns the principal for this security context.
- Returns:
- the principal or null of no provider for the thread.
isUserInRole
public static boolean isUserInRole(java.lang.String roleName)
throws SecurityContextException
- Returns true if the user principal is in the specified role.
- Parameters:
roleName
- the name of the role to test.
getProvider
public static SecurityContextProvider getProvider()
- Gets the provider for the current thread.
- Returns:
- the provider for the thread
setProvider
public static void setProvider(SecurityContextProvider provider)
- Sets the provider for the current thread.
- Parameters:
provider
- the new provider