public class SecurityFilterHolder extends java.lang.Object implements SecurityFilter
SecurityFilter
instance and allowing dispatching between them.SecurityFilter
Modifier and Type | Field and Description |
---|---|
protected AllGroupsSecurityFilter |
allgroups |
protected CurrentDetails |
cd |
protected java.lang.ThreadLocal<SecurityFilter> |
current |
protected OneGroupSecurityFilter |
onegroup |
protected SharingSecurityFilter |
share |
current_user, is_adminorpi, is_nonprivate, is_share
Constructor and Description |
---|
SecurityFilterHolder(CurrentDetails cd,
OneGroupSecurityFilter onegroup,
AllGroupsSecurityFilter allgroups,
SharingSecurityFilter share) |
Modifier and Type | Method and Description |
---|---|
SecurityFilter |
choose() |
void |
disable(org.hibernate.Session sess)
Reverts the call to
SecurityFilter.enable(Session, EventContext) . |
void |
enable(org.hibernate.Session sess,
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,
Details d,
EventContext c)
tests that the
Details argument passes the security test that
this filter defines. |
protected final AllGroupsSecurityFilter allgroups
protected final OneGroupSecurityFilter onegroup
protected final SharingSecurityFilter share
protected final CurrentDetails cd
protected java.lang.ThreadLocal<SecurityFilter> current
public SecurityFilterHolder(CurrentDetails cd, OneGroupSecurityFilter onegroup, AllGroupsSecurityFilter allgroups, SharingSecurityFilter share)
public SecurityFilter choose()
public java.lang.String getName()
SecurityFilter
getName
in interface SecurityFilter
public java.lang.String getDefaultCondition()
SecurityFilter
getDefaultCondition
in interface SecurityFilter
public java.util.Map<java.lang.String,java.lang.String> getParameterTypes()
SecurityFilter
getParameterTypes
in interface SecurityFilter
public void enable(org.hibernate.Session sess, EventContext ec)
SecurityFilter
SecurityFilter.passesFilter(Session, Details, EventContext)
.enable
in interface SecurityFilter
sess
- Non-null.ec
- Non-null.public void disable(org.hibernate.Session sess)
SecurityFilter
SecurityFilter.enable(Session, EventContext)
.disable
in interface SecurityFilter
public boolean passesFilter(org.hibernate.Session s, Details d, EventContext c)
SecurityFilter
Details
argument passes the security test that
this filter defines. The two must be kept in sync. This will be used
mostly by the
OmeroInterceptor.onLoad(Object, java.io.Serializable, Object[], String[], org.hibernate.type.Type[])
method.passesFilter
in interface SecurityFilter
d
- Details instance. If null (or if its Permissions
are
null all rights
will be assumed.
Version: 5.4.4-ice35-b82
Copyright © 2018 The University of Dundee & Open Microscopy Environment. All Rights Reserved.