public class OneGroupSecurityFilter extends AbstractSecurityFilter
FilterDefinitionFactoryBean
in order to construct our
security filter in code and not in XML. This allows us to make use of the
knowledge within Permissions
With the addition of shares in 4.0, it is necessary to remove the security
filter if a share is active and allow loading to throw the necessary
exceptions.Modifier and Type | Field and Description |
---|---|
static String |
current_group |
log, roles
current_user, is_adminorpi, is_nonprivate, is_share
Constructor and Description |
---|
OneGroupSecurityFilter()
Default constructor which calls all the necessary setters for this
FactoryBean . |
OneGroupSecurityFilter(Roles roles) |
Modifier and Type | Method and Description |
---|---|
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.
|
Map<String,String> |
getParameterTypes()
Return a mapping of the hibernate types for each of the parameters
that the condition takes.
|
protected String |
myFilterCondition() |
boolean |
passesFilter(org.hibernate.Session session,
Details d,
EventContext c)
tests that the
Details argument passes the security test that
this filter defines. |
disable, disableBaseFilters, enableBaseFilters, getName, isAdminOrPi, isNonPrivate, isShare
public static final String current_group
public OneGroupSecurityFilter()
FactoryBean
. Also calls FilterDefinitionFactoryBean.setDefaultFilterCondition(String)
.
This query clause must be kept in sync with
passesFilter(Session, Details, EventContext)
.passesFilter(Session, Details, EventContext)
,
FilterDefinitionFactoryBean.setFilterName(String)
,
FilterDefinitionFactoryBean.setParameterTypes(java.util.Map)
,
FilterDefinitionFactoryBean.setDefaultFilterCondition(String)
public OneGroupSecurityFilter(Roles roles)
protected String myFilterCondition()
public String getDefaultCondition()
SecurityFilter
public Map<String,String> getParameterTypes()
SecurityFilter
public boolean passesFilter(org.hibernate.Session session, Details d, EventContext c)
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.d
- Details instance. If null (or if its Permissions
are
null all rights
will be assumed.public void enable(org.hibernate.Session sess, EventContext ec)
SecurityFilter
SecurityFilter.passesFilter(Session, Details, EventContext)
.sess
- Non-null.ec
- Non-null.
Version: 5.2.4-ice35-b23
Copyright © 2016 The University of Dundee & Open Microscopy Environment. All Rights Reserved.