Package ome.security
Class SecurityFilterHolder
- java.lang.Object
-
- ome.security.SecurityFilterHolder
-
- All Implemented Interfaces:
SecurityFilter
public class SecurityFilterHolder extends java.lang.Object implements SecurityFilter
Security dispatcher holding each currently activeSecurityFilterinstance and allowing dispatching between them.- Since:
- 4.4
- See Also:
SecurityFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected AllGroupsSecurityFilterallgroupsprotected CurrentDetailscdprotected java.lang.ThreadLocal<SecurityFilter>currentprotected OneGroupSecurityFilteronegroupprotected SharingSecurityFiltershare-
Fields inherited from interface ome.security.SecurityFilter
current_user, is_adminorpi, is_nonprivate, is_share
-
-
Constructor Summary
Constructors Constructor Description SecurityFilterHolder(CurrentDetails cd, OneGroupSecurityFilter onegroup, AllGroupsSecurityFilter allgroups, SharingSecurityFilter share)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityFilterchoose()voiddisable(org.hibernate.Session sess)Reverts the call toSecurityFilter.enable(Session, EventContext).voidenable(org.hibernate.Session sess, ome.system.EventContext ec)Enables this filter with the settings from this filter.java.lang.StringgetDefaultCondition()Return the string to be used as the condition.java.lang.StringgetName()Name of this security filter.java.util.Map<java.lang.String,java.lang.String>getParameterTypes()Return a mapping of the hibernate types for each of the parameters that the condition takes.booleanpassesFilter(org.hibernate.Session s, ome.model.internal.Details d, ome.system.EventContext c)tests that theDetailsargument passes the security test that this filter defines.
-
-
-
Field Detail
-
allgroups
protected final AllGroupsSecurityFilter allgroups
-
onegroup
protected final OneGroupSecurityFilter onegroup
-
share
protected final SharingSecurityFilter share
-
cd
protected final CurrentDetails cd
-
current
protected java.lang.ThreadLocal<SecurityFilter> current
-
-
Constructor Detail
-
SecurityFilterHolder
public SecurityFilterHolder(CurrentDetails cd, OneGroupSecurityFilter onegroup, AllGroupsSecurityFilter allgroups, SharingSecurityFilter share)
-
-
Method Detail
-
choose
public SecurityFilter choose()
-
getName
public java.lang.String getName()
Description copied from interface:SecurityFilterName of this security filter. By default this will likely return the simple class name for the instance. This value will be used to activate the filter on the Hibernate session.- Specified by:
getNamein interfaceSecurityFilter
-
getDefaultCondition
public java.lang.String getDefaultCondition()
Description copied from interface:SecurityFilterReturn the string to be used as the condition.- Specified by:
getDefaultConditionin interfaceSecurityFilter
-
getParameterTypes
public java.util.Map<java.lang.String,java.lang.String> getParameterTypes()
Description copied from interface:SecurityFilterReturn a mapping of the hibernate types for each of the parameters that the condition takes.- Specified by:
getParameterTypesin interfaceSecurityFilter
-
enable
public void enable(org.hibernate.Session sess, ome.system.EventContext ec)Description copied from interface:SecurityFilterEnables this filter with the settings from this filter. The intent is that after this call, no Hibernate queries will return any objects that would fail a call toSecurityFilter.passesFilter(Session, Details, EventContext).- Specified by:
enablein interfaceSecurityFilter- Parameters:
sess- Non-null.ec- Non-null.
-
disable
public void disable(org.hibernate.Session sess)
Description copied from interface:SecurityFilterReverts the call toSecurityFilter.enable(Session, EventContext).- Specified by:
disablein interfaceSecurityFilter
-
passesFilter
public boolean passesFilter(org.hibernate.Session s, ome.model.internal.Details d, ome.system.EventContext c)Description copied from interface:SecurityFiltertests that theDetailsargument passes the security test that this filter defines. The two must be kept in sync. This will be used mostly by theOmeroInterceptor.onLoad(Object, java.io.Serializable, Object[], String[], org.hibernate.type.Type[])method.- Specified by:
passesFilterin interfaceSecurityFilterd- Details instance. If null (or if itsPermissionsare null allrightswill be assumed.- Returns:
- true if the object to which this
-
-