Package ome.security
Interface MethodSecurity
-
- All Known Implementing Classes:
BasicMethodSecurity
public interface MethodSecurityInterface which allows security interceptors to check if a method should be executable for a given user. This determination is most likely based onRolesAllowedannotations and replaces the security provided by an application server.- Since:
- 3.0-Beta2
- See Also:
SecuritySystem
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckMethod(java.lang.Object obj, java.lang.reflect.Method method, ome.system.Principal principal, boolean hasPassword)Throws aSecurityViolationexception if the givenPrincipaldoes not have the proper permissions to execute the given method.booleanisActive()Indicates whether or not method security is active.
-
-
-
Method Detail
-
isActive
boolean isActive()
Indicates whether or not method security is active. If not, then no further checks should be made, and implementations are free to throw exceptions if they are not properly initialized. Clients of this interface can assume that method-level security has been configured elsewhere.- Returns:
- true if the other methods of this interface can and should be called.
-
checkMethod
void checkMethod(java.lang.Object obj, java.lang.reflect.Method method, ome.system.Principal principal, boolean hasPassword) throws ome.conditions.SecurityViolationThrows aSecurityViolationexception if the givenPrincipaldoes not have the proper permissions to execute the given method. IfisActive()returns false, this method may also throw anyRuntimeExceptionto specify that it is not in an active state.- Parameters:
obj-Objecton which this method will be called.method-Methodto be called.principal-Principalfor which permissions will be checked.hasPassword- flag if the user's session has been authenticated directly and not via a one-time session id or similar.- Throws:
ome.conditions.SecurityViolation- if the given pr
-
-