Package ome.security

Interface SecurityFilter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void disable​(org.hibernate.Session sess)
      Reverts the call to enable(Session, EventContext).
      void enable​(org.hibernate.Session sess, 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.lang.String getName()
      Name of this security filter.
      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 d, ome.system.EventContext c)
      tests that the Details argument passes the security test that this filter defines.
    • Method Detail

      • getName

        java.lang.String getName()
        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.
      • getParameterTypes

        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.
      • getDefaultCondition

        java.lang.String getDefaultCondition()
        Return the string to be used as the condition.
      • passesFilter

        boolean passesFilter​(org.hibernate.Session session,
                             ome.model.internal.Details d,
                             ome.system.EventContext c)
        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.
        Parameters:
        d - Details instance. If null (or if its Permissions are null all rights will be assumed.
        Returns:
        true if the object to which this
      • enable

        void enable​(org.hibernate.Session sess,
                    ome.system.EventContext ec)
        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 passesFilter(Session, Details, EventContext).
        Parameters:
        sess - Non-null.
        ec - Non-null.