org.loom.security
Class SpringSecurityAdapter
java.lang.Object
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)
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 |
SpringSecurityAdapter
public SpringSecurityAdapter()
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)