Class Access

java.lang.Object
org.apache.druid.server.security.Access

public class Access extends Object
Represents the outcome of verifying permissions to perform an Action on a Resource, along with any applicable policy restrictions. The restriction should only exist for Action.READ and ResourceType.DATASOURCE, i.e, reading a table.
  • Field Details

  • Constructor Details

  • Method Details

    • allow

      public static Access allow()
      Constructs Access instance with access allowed, with no policy restriction.
    • deny

      public static Access deny(@Nullable String message)
      Contructs Access instance with access denied.
    • allowWithRestriction

      public static Access allowWithRestriction(Policy policy)
      Contructs Access instance with access allowed, but with policy restriction.
    • isAllowed

      public boolean isAllowed()
      Returns true if access allowed, ignoring any policy restrictions.
    • getPolicy

      public Optional<Policy> getPolicy()
      Returns an optional Policy restriction if permission is granted. Only applies to read table access.

      An empty value indicates either no policy restrictions exist, or access is being requested for an action other than reading a table.

    • getMessage

      public String getMessage()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object