Interface PolicyService

    • Method Detail

      • isRestricted

        boolean isRestricted​(java.lang.String name,
                             ome.model.IObject obj)
        Ask each configured Policy instance with the given name argument if it considers the restriction active for the given IObject argument. If any are active, return true.
        Parameters:
        name - non-null identifier of a class of Policy instances.
        obj - non-null "context" for this check.
        Returns:
        true if any Policy returns true from Policy.isRestricted(IObject).
      • checkRestriction

        void checkRestriction​(java.lang.String name,
                              ome.model.IObject obj)
                       throws ome.conditions.SecurityViolation
        Give each configured Policy instance the chance to throw a SecurityViolation from its Policy.checkRestriction(IObject) method.
        Parameters:
        name - non-null identifier of a class of Policy instances.
        obj - non-null "context" for this check.
        Throws:
        ome.conditions.SecurityViolation
      • listActiveRestrictions

        java.util.Set<java.lang.String> listActiveRestrictions​(ome.model.IObject obj)
        Return all identifier strings as would be passed as the first argument to isRestricted(String, IObject) or checkRestriction(String, IObject) which considers itself active for the given argument.
        Parameters:
        obj - non-null context passed to each Policy instance.
        Returns:
        a possibly empty string set of identifiers which should be returned to clients via Permissions.copyExtendedRestrictions() .