Class SharingSecurityFilter

  • 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

    public class SharingSecurityFilter
    extends AbstractSecurityFilter
    The sharing security filter provides database-level access protection for share contexts.
    Since:
    5.2.5
    See Also:
    SharingACLVoter
    • Constructor Summary

      Constructors 
      Constructor Description
      SharingSecurityFilter​(ome.system.Roles roles, ShareStore shares)
      Construct a new sharing security filter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void enable​(org.hibernate.Session session, ome.system.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.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 session, ome.model.internal.Details details, ome.system.EventContext ec)
      tests that the Details argument passes the security test that this filter defines.
      • 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
    • Constructor Detail

      • SharingSecurityFilter

        public SharingSecurityFilter​(ome.system.Roles roles,
                                     ShareStore shares)
        Construct a new sharing security filter.
        Parameters:
        roles - the users and groups that are special to OMERO
        shares - the shares
    • Method Detail

      • getParameterTypes

        public java.util.Map<java.lang.String,​java.lang.String> getParameterTypes()
        Description copied from interface: SecurityFilter
        Return a mapping of the hibernate types for each of the parameters that the condition takes.
      • getDefaultCondition

        public java.lang.String getDefaultCondition()
        Description copied from interface: SecurityFilter
        Return the string to be used as the condition.
      • passesFilter

        public boolean passesFilter​(org.hibernate.Session session,
                                    ome.model.internal.Details details,
                                    ome.system.EventContext ec)
        Description copied from interface: SecurityFilter
        tests that the 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.
        details - Details instance. If null (or if its Permissions are null all rights will be assumed.
        Returns:
        true if the object to which this
      • enable

        public void enable​(org.hibernate.Session session,
                           ome.system.EventContext ec)
        Description copied from interface: SecurityFilter
        Enables this filter with the settings from this filter. The intent is that after this call, no Hibernate queries will return any objects that would fail a call to SecurityFilter.passesFilter(Session, Details, EventContext).
        Parameters:
        session - Non-null.
        ec - Non-null.