Package ome.security.basic
Class AbstractSecurityFilter
- java.lang.Object
-
- org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
-
- ome.security.basic.AbstractSecurityFilter
-
- All Implemented Interfaces:
SecurityFilter
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.FactoryBean<org.hibernate.engine.FilterDefinition>
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AllGroupsSecurityFilter
,LightAdminPrivilegesSecurityFilter
,OneGroupSecurityFilter
,SharingSecurityFilter
public abstract class AbstractSecurityFilter extends org.springframework.orm.hibernate3.FilterDefinitionFactoryBean implements SecurityFilter
overridesFilterDefinitionFactoryBean
in order to construct our security filter in code and not in XML. This allows us to make use of the knowledge withinPermissions
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
protected ome.system.Roles
roles
-
Fields inherited from interface ome.security.SecurityFilter
current_user, is_adminorpi, is_nonprivate, is_share
-
-
Constructor Summary
Constructors Constructor Description AbstractSecurityFilter()
Default constructor which calls all the necessary setters for thisFactoryBean
.AbstractSecurityFilter(ome.system.Roles roles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disable(org.hibernate.Session sess)
Reverts the call toSecurityFilter.enable(Session, EventContext)
.protected void
disableBaseFilters(org.hibernate.Session sess)
protected void
enableBaseFilters(org.hibernate.Session sess, int admin01, java.lang.Long currentUserId)
java.lang.String
getName()
Name of this security filter.boolean
isAdminOrPi(ome.system.EventContext c)
boolean
isNonPrivate(ome.system.EventContext c)
boolean
isShare(ome.system.EventContext c)
-
Methods inherited from class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
afterPropertiesSet, getObject, getObjectType, isSingleton, setBeanName, setDefaultFilterCondition, setFilterName, setParameterTypes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ome.security.SecurityFilter
enable, getDefaultCondition, getParameterTypes, passesFilter
-
-
-
-
Constructor Detail
-
AbstractSecurityFilter
public AbstractSecurityFilter()
Default constructor which calls all the necessary setters for thisFactoryBean
. Also callsFilterDefinitionFactoryBean.setDefaultFilterCondition(String)
. This query clause must be kept in sync withSecurityFilter.passesFilter(Session, Details, EventContext)
.- See Also:
SecurityFilter.passesFilter(Session, Details, EventContext)
,FilterDefinitionFactoryBean.setFilterName(String)
,FilterDefinitionFactoryBean.setParameterTypes(java.util.Map)
,FilterDefinitionFactoryBean.setDefaultFilterCondition(String)
-
AbstractSecurityFilter
public AbstractSecurityFilter(ome.system.Roles roles)
-
-
Method Detail
-
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
-
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
-
isNonPrivate
public boolean isNonPrivate(ome.system.EventContext c)
-
isAdminOrPi
public boolean isAdminOrPi(ome.system.EventContext c)
-
isShare
public boolean isShare(ome.system.EventContext c)
-
enableBaseFilters
protected void enableBaseFilters(org.hibernate.Session sess, int admin01, java.lang.Long currentUserId)
-
disableBaseFilters
protected void disableBaseFilters(org.hibernate.Session sess)
-
-