# Document level access

**URL:** https://discuss.elastic.co/t/document-level-access/251536
**Category:** Kibana
**Tags:** kql-kibana-query-language
**Created:** [October 9, 2020, 7:07am UTC](https://discuss.elastic.co/t/document-level-access/251536 "2020-10-09T07:07:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Rahul0711](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@Rahul0711](https://discuss.elastic.co/u/Rahul0711)
#### Post date: [October 9, 2020, 7:07am UTC](https://discuss.elastic.co/t/document-level-access/251536/1 "2020-10-09T07:07:20Z")

</div>

Hello Team

I am trying to create role at the document level , but getting the error as attached. I am using xpack to create the role.  
Link followed

> **[Document level security | Elasticsearch Reference \[7.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/document-level-security.html)**

  

> **[Setting up field and document level security | Elasticsearch Reference \[7.9\]...](https://www.elastic.co/guide/en/elasticsearch/reference/current/field-and-document-access-control.html)**

While running the query getting the error attached .

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a25d83d3b8fc409913b2e13ef94bad78524d0a4.png)

---

<div class="post-metadata">

### Author: ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)
#### Post date: [October 9, 2020, 9:31am UTC](https://discuss.elastic.co/t/document-level-access/251536/2 "2020-10-09T09:31:12Z")

</div>

Hi Rahul,

this is a simple sytnax error in the query. You need to wrap it in enclosing curly braces:

```json
{ "term": { "RESOURCE_GROUP": "J:JWT:US:P" } }

```

I've created [https://github.com/elastic/kibana/issues/80102](https://github.com/elastic/kibana/issues/80102) for you to track improving this error in the UI to make clear what's going on.

Cheers,  
Tim

---

<div class="post-metadata">

### Author: ![Rahul0711](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@Rahul0711](https://discuss.elastic.co/u/Rahul0711)
#### Post date: [October 13, 2020, 6:21am UTC](https://discuss.elastic.co/t/document-level-access/251536/3 "2020-10-13T06:21:12Z")

</div>

Hello Tim

Unable to login to Git repo.... what ll be the login credentials  
In the meantime....query worked didnt give any error but its not filtering the data.... When I use the above query it does not filter the data to that document... What might the the cause ...

Regards  
Rahul

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 10, 2020, 6:21am UTC](https://discuss.elastic.co/t/document-level-access/251536/4 "2020-11-10T06:21:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
