Class IndicesPrivileges

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

public final class IndicesPrivileges
extends AbstractIndicesPrivileges
implements org.elasticsearch.common.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 java.lang.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​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

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

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

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

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

      public static IndicesPrivileges.Builder builder()