Package ome.security.basic
Class BasicMethodSecurity
- java.lang.Object
-
- ome.security.basic.BasicMethodSecurity
-
- All Implemented Interfaces:
MethodSecurity
public class BasicMethodSecurity extends java.lang.Object implements MethodSecurity
Implementation ofMethodSecurity
which checks method security based on theRolesAllowed
annotations of our implementation methods. To do this, it is necessary to "unwrap" proxies via theAdvised
interface.- Since:
- 3.0-Beta2
- See Also:
SecuritySystem
-
-
Constructor Summary
Constructors Constructor Description BasicMethodSecurity()
BasicMethodSecurity(boolean active)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkMethod(java.lang.Object o, java.lang.reflect.Method m, ome.system.Principal p, boolean hasPassword)
Throws aSecurityViolation
exception if the givenPrincipal
does not have the proper permissions to execute the given method.boolean
isActive()
void
setSessionManager(SessionManager sessionManager)
-
-
-
Method Detail
-
setSessionManager
public void setSessionManager(SessionManager sessionManager)
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceMethodSecurity
- Returns:
- true if the other methods of this interface can and should be called.
-
checkMethod
public void checkMethod(java.lang.Object o, java.lang.reflect.Method m, ome.system.Principal p, boolean hasPassword)
Description copied from interface:MethodSecurity
Throws aSecurityViolation
exception if the givenPrincipal
does not have the proper permissions to execute the given method. IfMethodSecurity.isActive()
returns false, this method may also throw anyRuntimeException
to specify that it is not in an active state.- Specified by:
checkMethod
in interfaceMethodSecurity
- Parameters:
o
-Object
on which this method will be called.m
-Method
to be called.p
-Principal
for 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.- See Also:
MethodSecurity.checkMethod(Object, Method, Principal, boolean)
-
-