Class IndicesPrivileges

java.lang.Object
org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
org.elasticsearch.client.security.user.privileges.IndicesPrivileges
All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public final class IndicesPrivileges extends AbstractIndicesPrivileges implements org.elasticsearch.xcontent.ToXContentObject
Represents privileges over indices. There is a canonical set of privilege names (eg. IndicesPrivileges#READ_PRIVILEGE_NAME) but there is flexibility in the definition of finer grained, more specialized, privileges. This also encapsulates field and document level security privileges. These allow to control what fields or documents are readable or queryable.
  • Method Details

    • getFieldSecurity

      public AbstractIndicesPrivileges.FieldSecurity getFieldSecurity()
      The combination of the granted and denied document fields. May be null, in which case no field level security is applicable, and all the document's fields are granted access to.
    • getQuery

      @Nullable public String getQuery()
      A query limiting the visible documents in the indices. Can be null, in which case all documents are visible.
    • isUsingDocumentLevelSecurity

      public boolean isUsingDocumentLevelSecurity()
      If true some documents might not be visible. Only the documents matching query will be readable.
      Specified by:
      isUsingDocumentLevelSecurity in class AbstractIndicesPrivileges
    • isUsingFieldLevelSecurity

      public boolean isUsingFieldLevelSecurity()
      If true some document fields might not be visible.
      Specified by:
      isUsingFieldLevelSecurity in class AbstractIndicesPrivileges
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • fromXContent

      public static IndicesPrivileges fromXContent(org.elasticsearch.xcontent.XContentParser parser)
    • builder

      public static IndicesPrivileges.Builder builder()