Class BasePolicy

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Set<java.lang.Class<ome.model.IObject>> types  
    • Constructor Summary

      Constructors 
      Constructor Description
      BasePolicy​(java.util.Set<java.lang.Class<ome.model.IObject>> types)  
    • Field Detail

      • types

        protected final java.util.Set<java.lang.Class<ome.model.IObject>> types
    • Constructor Detail

      • BasePolicy

        public BasePolicy​(java.util.Set<java.lang.Class<ome.model.IObject>> types)
    • Method Detail

      • getName

        public abstract java.lang.String getName()
        Description copied from interface: Policy
        Unique name for a class of restrictions that this Policy will enforce. This string will be sent to clients via Permissions.copyExtendedRestrictions() in order to prevent exceptions, and server-code will pass the same name to the check method to potentially have an exception thrown.
        Specified by:
        getName in interface Policy
      • getTypes

        public java.util.Set<java.lang.Class<ome.model.IObject>> getTypes()
        Description copied from interface: Policy
        Each Policy should tell the PolicyService which types of IObject instances it cares about. Only those which are of interest to some Policy need be considered.
        Specified by:
        getTypes in interface Policy
      • isRestricted

        public boolean isRestricted​(ome.model.IObject obj)
        Description copied from interface: Policy
        Checks whether or not this instance would throw a SecurityViolation if the same instance were passed to Policy.checkRestriction(IObject). This is likely determined by first testing the type of the IObject and then that the current user context has access to the given context.
        Specified by:
        isRestricted in interface Policy
        Parameters:
        obj - a non-null IObject instance.
        Returns:
        true if this Policy decides that a restriction should be placed on the passed context.
      • checkRestriction

        public void checkRestriction​(ome.model.IObject obj)
        Description copied from interface: Policy
        Like Policy.isRestricted(IObject) but throws an appropriate SecurityViolation subclass if the restriction is active.
        Specified by:
        checkRestriction in interface Policy