org.loom.security
Class SpringSecurityAdapter

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

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

Adapts the spring security project (formerly known as acegi security)


Constructor Summary
SpringSecurityAdapter()
           
 
Method Summary
 java.lang.String getRolePrefix()
           
 boolean hasRole(java.lang.String[] allowedRoles)
          Iterates the list of GrantedAuthority for this user, and returns true if one of them is included in the list of authorized roles.
 void setRolePrefix(java.lang.String rolePrefix)
           
 void throwInsufficientPermissionsException(java.lang.String message)
          This method will throw an instance of AccessDeniedException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringSecurityAdapter

public SpringSecurityAdapter()
Method Detail

hasRole

public boolean hasRole(java.lang.String[] allowedRoles)
Description copied from interface: SecurityAdapter
Iterates the list of GrantedAuthority for this user, and returns true if one of them is included in the list of authorized roles.

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 method will throw an instance of AccessDeniedException

Specified by:
throwInsufficientPermissionsException in interface SecurityAdapter

getRolePrefix

public java.lang.String getRolePrefix()

setRolePrefix

public void setRolePrefix(java.lang.String rolePrefix)