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.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndicesPrivileges.Builder
Nested classes/interfaces inherited from class org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
AbstractIndicesPrivileges.FieldSecurity
-
Field Summary
Fields inherited from class org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
allowRestrictedIndices, indices, privileges
-
Method Summary
Modifier and Type Method Description static IndicesPrivileges.Builder
builder()
boolean
equals(java.lang.Object o)
static IndicesPrivileges
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
AbstractIndicesPrivileges.FieldSecurity
getFieldSecurity()
java.lang.String
getQuery()
A query limiting the visible documents in the indices.int
hashCode()
boolean
isUsingDocumentLevelSecurity()
Iftrue
some documents might not be visible.boolean
isUsingFieldLevelSecurity()
Iftrue
some document fields might not be visible.java.lang.String
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Methods inherited from class org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
allowRestrictedIndices, getIndices, getPrivileges
-
Method Details
-
getFieldSecurity
-
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()Iftrue
some documents might not be visible. Only the documents matchingquery
will be readable.- Specified by:
isUsingDocumentLevelSecurity
in classAbstractIndicesPrivileges
-
isUsingFieldLevelSecurity
public boolean isUsingFieldLevelSecurity()Iftrue
some document fields might not be visible.- Specified by:
isUsingFieldLevelSecurity
in classAbstractIndicesPrivileges
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.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 interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
fromXContent
public static IndicesPrivileges fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) -
builder
-