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.


Method Summary
static SecurityContextProvider getProvider()
          Gets the provider for the current thread.
static java.security.Principal getUserPrincipal()
          Returns the principal for this security context.
static boolean isUserInRole(java.lang.String roleName)
          Returns true if the user principal is in the specified role.
static void setProvider(SecurityContextProvider provider)
          Sets the provider for the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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