org.loom.security
Interface SecurityAdapter

All Known Implementing Classes:
JeeSecurityAdapter, SpringSecurityAdapter

public interface SecurityAdapter

Common security API for custom security providers


Method Summary
 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 throwInsufficientPermissionsException(java.lang.String message)
          Throw a provider-specific exception for not enough permissions.
 

Method Detail

hasRole

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.

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

void throwInsufficientPermissionsException(java.lang.String message)
Throw a provider-specific exception for not enough permissions.