public class SecurityFilterHolder extends Object implements SecurityFilter
SecurityFilter
instance and allowing dispatching between them.SecurityFilter
Modifier and Type | Field and Description |
---|---|
protected AllGroupsSecurityFilter |
allgroups |
protected CurrentDetails |
cd |
protected 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.
|
String |
getDefaultCondition()
Return the string to be used as the condition.
|
String |
getName()
Name of this security filter.
|
Map<String,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 ThreadLocal<SecurityFilter> current
public SecurityFilterHolder(CurrentDetails cd, OneGroupSecurityFilter onegroup, AllGroupsSecurityFilter allgroups, SharingSecurityFilter share)
public SecurityFilter choose()
public String getName()
SecurityFilter
getName
in interface SecurityFilter
public String getDefaultCondition()
SecurityFilter
getDefaultCondition
in interface SecurityFilter
public Map<String,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.2.8-ice35-b57
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.