Class IndicesPrivileges

  • All Implemented Interfaces:
    ToXContent, ToXContentObject

    public final class IndicesPrivileges
    extends java.lang.Object
    implements 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.
    • Field Detail

      • PRIVILEGES

        public static final ParseField PRIVILEGES
      • FIELD_PERMISSIONS

        public static final ParseField FIELD_PERMISSIONS
      • GRANT_FIELDS

        public static final ParseField GRANT_FIELDS
      • EXCEPT_FIELDS

        public static final ParseField EXCEPT_FIELDS
    • Method Detail

      • getIndices

        public java.util.Set<java.lang.String> getIndices()
        The indices names covered by the privileges.
      • getPrivileges

        public java.util.Set<java.lang.String> getPrivileges()
        The privileges acting over indices. There is a canonical predefined set of such privileges, but the String datatype allows for flexibility in defining finer grained privileges.
      • getGrantedFields

        @Nullable
        public java.util.Set<java.lang.String> getGrantedFields()
        The document fields that can be read or queried. Can be null, in this case all the document's fields are granted access to. Can also be empty, in which case no fields are granted access to.
      • getDeniedFields

        @Nullable
        public java.util.Set<java.lang.String> getDeniedFields()
        The document fields that cannot be accessed or queried. Can be null or empty, in which case no fields are denied.
      • 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.
      • isUsingFieldLevelSecurity

        public boolean isUsingFieldLevelSecurity()
        If true some document fields might not be visible.
      • 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