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 activeSecurityFilter
instance and allowing dispatching between them.- Since:
- 4.4
- See Also:
SecurityFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected AllGroupsSecurityFilter
allgroups
protected CurrentDetails
cd
protected java.lang.ThreadLocal<SecurityFilter>
current
protected OneGroupSecurityFilter
onegroup
protected SharingSecurityFilter
share
-
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 SecurityFilter
choose()
void
disable(org.hibernate.Session sess)
Reverts the call toSecurityFilter.enable(Session, EventContext)
.void
enable(org.hibernate.Session sess, ome.system.EventContext ec)
Enables this filter with the settings from this filter.java.lang.String
getDefaultCondition()
Return the string to be used as the condition.java.lang.String
getName()
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.boolean
passesFilter(org.hibernate.Session s, ome.model.internal.Details d, ome.system.EventContext c)
tests that theDetails
argument 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:SecurityFilter
Name 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:
getName
in interfaceSecurityFilter
-
getDefaultCondition
public java.lang.String getDefaultCondition()
Description copied from interface:SecurityFilter
Return the string to be used as the condition.- Specified by:
getDefaultCondition
in interfaceSecurityFilter
-
getParameterTypes
public java.util.Map<java.lang.String,java.lang.String> getParameterTypes()
Description copied from interface:SecurityFilter
Return a mapping of the hibernate types for each of the parameters that the condition takes.- Specified by:
getParameterTypes
in interfaceSecurityFilter
-
enable
public void enable(org.hibernate.Session sess, ome.system.EventContext ec)
Description copied from interface:SecurityFilter
Enables 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:
enable
in interfaceSecurityFilter
- Parameters:
sess
- Non-null.ec
- Non-null.
-
disable
public void disable(org.hibernate.Session sess)
Description copied from interface:SecurityFilter
Reverts the call toSecurityFilter.enable(Session, EventContext)
.- Specified by:
disable
in interfaceSecurityFilter
-
passesFilter
public boolean passesFilter(org.hibernate.Session s, ome.model.internal.Details d, ome.system.EventContext c)
Description copied from interface:SecurityFilter
tests that theDetails
argument 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:
passesFilter
in interfaceSecurityFilter
d
- Details instance. If null (or if itsPermissions
are null allrights
will be assumed.- Returns:
- true if the object to which this
-
-