public abstract class AbstractSecurityFilter extends org.springframework.orm.hibernate3.FilterDefinitionFactoryBean implements SecurityFilter
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 |
---|---|
protected org.slf4j.Logger |
log |
protected Roles |
roles |
current_user, is_adminorpi, is_nonprivate, is_share
Constructor and Description |
---|
AbstractSecurityFilter()
Default constructor which calls all the necessary setters for this
FactoryBean . |
AbstractSecurityFilter(Roles roles) |
Modifier and Type | Method and Description |
---|---|
void |
disable(org.hibernate.Session sess)
Reverts the call to
SecurityFilter.enable(Session, EventContext) . |
protected void |
disableBaseFilters(org.hibernate.Session sess) |
protected void |
enableBaseFilters(org.hibernate.Session sess,
int admin01,
Long currentUserId) |
String |
getName()
Name of this security filter.
|
boolean |
isAdminOrPi(EventContext c) |
boolean |
isNonPrivate(EventContext c) |
boolean |
isShare(EventContext c) |
afterPropertiesSet, getObject, getObjectType, isSingleton, setBeanName, setDefaultFilterCondition, setFilterName, setParameterTypes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enable, getDefaultCondition, getParameterTypes, passesFilter
protected final org.slf4j.Logger log
protected final Roles roles
public AbstractSecurityFilter()
FactoryBean
. Also calls FilterDefinitionFactoryBean.setDefaultFilterCondition(String)
.
This query clause must be kept in sync with
SecurityFilter.passesFilter(Session, Details, EventContext)
.SecurityFilter.passesFilter(Session, Details, EventContext)
,
FilterDefinitionFactoryBean.setFilterName(String)
,
FilterDefinitionFactoryBean.setParameterTypes(java.util.Map)
,
FilterDefinitionFactoryBean.setDefaultFilterCondition(String)
public AbstractSecurityFilter(Roles roles)
public String getName()
SecurityFilter
getName
in interface SecurityFilter
public void disable(org.hibernate.Session sess)
SecurityFilter
SecurityFilter.enable(Session, EventContext)
.disable
in interface SecurityFilter
public boolean isNonPrivate(EventContext c)
public boolean isAdminOrPi(EventContext c)
public boolean isShare(EventContext c)
protected void enableBaseFilters(org.hibernate.Session sess, int admin01, Long currentUserId)
protected void disableBaseFilters(org.hibernate.Session sess)
Version: 5.4.0-ice35-b74
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.