Class IndicesPrivileges
- java.lang.Object
-
- org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
-
- org.elasticsearch.client.security.user.privileges.IndicesPrivileges
-
- All Implemented Interfaces:
ToXContent
,ToXContentObject
public final class IndicesPrivileges extends AbstractIndicesPrivileges 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.
-
-
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
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
allowRestrictedIndices, indices, privileges
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
Modifier and Type Method Description static IndicesPrivileges.Builder
builder()
boolean
equals(java.lang.Object o)
static IndicesPrivileges
fromXContent(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()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
-
Methods inherited from class org.elasticsearch.client.security.user.privileges.AbstractIndicesPrivileges
allowRestrictedIndices, getIndices, getPrivileges
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Method Detail
-
getFieldSecurity
public AbstractIndicesPrivileges.FieldSecurity 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 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
fromXContent
public static IndicesPrivileges fromXContent(XContentParser parser)
-
builder
public static IndicesPrivileges.Builder builder()
-
-