Record Class AuthorizationEngine.PrivilegesToCheck

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.PrivilegesToCheck
Enclosing interface:
AuthorizationEngine

public static record AuthorizationEngine.PrivilegesToCheck(String[] cluster, RoleDescriptor.IndicesPrivileges[] index, RoleDescriptor.ApplicationResourcePrivileges[] application, boolean runDetailedCheck) extends Record
This encapsulates the privileges that can be checked for access. It's intentional that the privileges to be checked are specified in the same manner that they are granted in the RoleDescriptor. The privilege check can be detailed or not, per the runDetailedCheck parameter. The detailed response AuthorizationEngine.PrivilegesCheckResult of a check run, also shows which privileges are NOT granted.
  • Constructor Details

    • PrivilegesToCheck

      public PrivilegesToCheck(String[] cluster, RoleDescriptor.IndicesPrivileges[] index, RoleDescriptor.ApplicationResourcePrivileges[] application, boolean runDetailedCheck)
      Creates an instance of a PrivilegesToCheck record class.
      Parameters:
      cluster - the value for the cluster record component
      index - the value for the index record component
      application - the value for the application record component
      runDetailedCheck - the value for the runDetailedCheck record component
  • Method Details

    • readFrom

      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Throws:
      IOException
    • validate

    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • cluster

      public String[] cluster()
      Returns the value of the cluster record component.
      Returns:
      the value of the cluster record component
    • index

      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • application

      Returns the value of the application record component.
      Returns:
      the value of the application record component
    • runDetailedCheck

      public boolean runDetailedCheck()
      Returns the value of the runDetailedCheck record component.
      Returns:
      the value of the runDetailedCheck record component