org.loom.security
Class JeeSecurityAdapter

java.lang.Object
  extended by org.loom.security.JeeSecurityAdapter
All Implemented Interfaces:
SecurityAdapter

@Singleton
public class JeeSecurityAdapter
extends java.lang.Object
implements SecurityAdapter

Adapts standard JAAS


Constructor Summary
JeeSecurityAdapter()
           
 
Method Summary
 boolean hasRole(java.lang.String[] allowedRoles)
          Calls the HttpServletRequest.isUserInRole() method for each allowedRole
 void throwInsufficientPermissionsException(java.lang.String message)
          This implementation will throw an instance of HttpException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JeeSecurityAdapter

public JeeSecurityAdapter()
Method Detail

hasRole

public boolean hasRole(java.lang.String[] allowedRoles)
Calls the HttpServletRequest.isUserInRole() method for each allowedRole

Specified by:
hasRole in interface SecurityAdapter
Parameters:
allowedRoles - the list of roles to check.
Returns:
true if any of the provided roles is associated to the current request principal, false otherwise.

throwInsufficientPermissionsException

public void throwInsufficientPermissionsException(java.lang.String message)
This implementation will throw an instance of HttpException

Specified by:
throwInsufficientPermissionsException in interface SecurityAdapter