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 ofMethodSecuritywhich checks method security based on theRolesAllowedannotations of our implementation methods. To do this, it is necessary to "unwrap" proxies via theAdvisedinterface.- 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 voidcheckMethod(java.lang.Object o, java.lang.reflect.Method m, ome.system.Principal p, boolean hasPassword)Throws aSecurityViolationexception if the givenPrincipaldoes not have the proper permissions to execute the given method.booleanisActive()voidsetSessionManager(SessionManager sessionManager)
-
-
-
Method Detail
-
setSessionManager
public void setSessionManager(SessionManager sessionManager)
-
isActive
public boolean isActive()
- Specified by:
isActivein 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:MethodSecurityThrows aSecurityViolationexception if the givenPrincipaldoes not have the proper permissions to execute the given method. IfMethodSecurity.isActive()returns false, this method may also throw anyRuntimeExceptionto specify that it is not in an active state.- Specified by:
checkMethodin interfaceMethodSecurity- Parameters:
o-Objecton which this method will be called.m-Methodto be called.p-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.- See Also:
MethodSecurity.checkMethod(Object, Method, Principal, boolean)
-
-