Class IndicesPrivileges
- java.lang.Object
-
- org.elasticsearch.client.security.user.privileges.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndicesPrivileges.Builder
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description static ParseField
EXCEPT_FIELDS
static ParseField
FIELD_PERMISSIONS
static ParseField
GRANT_FIELDS
static ParseField
NAMES
static ParseField
PRIVILEGES
static ParseField
QUERY
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IndicesPrivileges.Builder
builder()
boolean
equals(java.lang.Object o)
static IndicesPrivileges
fromXContent(XContentParser parser)
java.util.Set<java.lang.String>
getDeniedFields()
The document fields that cannot be accessed or queried.java.util.Set<java.lang.String>
getGrantedFields()
The document fields that can be read or queried.java.util.Set<java.lang.String>
getIndices()
The indices names covered by the privileges.java.util.Set<java.lang.String>
getPrivileges()
The privileges acting over indices.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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAMES
public static final ParseField NAMES
-
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
-
QUERY
public static final ParseField QUERY
-
-
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 theString
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()
Iftrue
some documents might not be visible. Only the documents matchingquery
will be readable.
-
isUsingFieldLevelSecurity
public boolean isUsingFieldLevelSecurity()
Iftrue
some document fields might not be visible.
-
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()
-
-