# Problem with connectiong roles

**URL:** <https://forum.opensearch.org/t/problem-with-connectiong-roles/3479>\
**Category:** General Feedback\
**Created:** [August 10, 2020, 7:44am UTC](https://forum.opensearch.org/t/problem-with-connectiong-roles/3479 "2020-08-10T07:44:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luj\_ogluszacz](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@luj\_ogluszacz](https://forum.opensearch.org/u/luj_ogluszacz)\
**Post date:** [August 10, 2020, 7:44am UTC](https://forum.opensearch.org/t/problem-with-connectiong-roles/3479/1 "2020-08-10T07:44:15Z")

</div>

I have 2 roles that are assigned to one user. In the first role, I include field name for documents which have \_id 1 and 2

> Blockquote  
> {  
> “index\_permissions”: [  
> {  
> “index\_patterns”: [  
> “test”  
> ],  
> “dls”: “{\n "terms": {\n "\_id": ["1", "2"] \n }\n}\n\n”,  
> “fls”: [  
> “name”  
> ],  
> “masked\_fields”: ,  
> “allowed\_actions”: [  
> “get”,  
> “crud”  
> ]  
> }  
> ],  
> “tenant\_permissions”: ,  
> “cluster\_permissions”: [  
> “\*”  
> ]  
> }  
> Blockquote

and in the second role, I include field job\_description for a document which have \_id 3

> Blockquote  
> {  
> “index\_permissions”: [  
> {  
> “index\_patterns”: [  
> “test”  
> ],  
> “dls”: “{\n "terms": {\n "\_id": ["3"] \n }\n}\n”,  
> “fls”: [  
> “job\_description”  
> ],  
> “masked\_fields”: ,  
> “allowed\_actions”:   
> }  
> ],  
> “tenant\_permissions”: ,  
> “cluster\_permissions”:   
> }  
> Blockquote

when I try to get data from the index it shows me job\_description and name in all documents,

> Blockquote  
> {  
> “took” : 237,  
> “timed\_out” : false,  
> “\_shards” : {  
> “total” : 1,  
> “successful” : 1,  
> “skipped” : 0,  
> “failed” : 0  
> },  
> “hits” : {  
> “total” : {  
> “value” : 3,  
> “relation” : “eq”  
> },  
> “max\_score” : 2.0,  
> “hits” : [  
> {  
> “\_index” : “test”,  
> “\_type” : “\_doc”,  
> “\_id” : “1”,  
> “\_score” : 2.0,  
> “\_source” : {  
> “name” : “John”,  
> “job\_description” : “Systems administrator and Linux specialist”  
> }  
> },  
> {  
> “\_index” : “test”,  
> “\_type” : “\_doc”,  
> “\_id” : “2”,  
> “\_score” : 2.0,  
> “\_source” : {  
> “name” : “John”,  
> “job\_description” : “Systems administrator and Linux specialist”  
> }  
> },  
> {  
> “\_index” : “test”,  
> “\_type” : “\_doc”,  
> “\_id” : “3”,  
> “\_score” : 2.0,  
> “\_source” : {  
> “name” : “John”,  
> “job\_description” : “Systems administrator and Linux specialist”  
> }  
> }  
> ]  
> }  
> }  
> Blockquote

but I want to see the only name in two firs records and only job\_description in 3 document like that

> Blockquote  
> {  
> “took” : 237,  
> “timed\_out” : false,  
> “\_shards” : {  
> “total” : 1,  
> “successful” : 1,  
> “skipped” : 0,  
> “failed” : 0  
> },  
> “hits” : {  
> “total” : {  
> “value” : 3,  
> “relation” : “eq”  
> },  
> “max\_score” : 2.0,  
> “hits” : [  
> {  
> “\_index” : “test”,  
> “\_type” : “\_doc”,  
> “\_id” : “1”,  
> “\_score” : 2.0,  
> “\_source” : {  
> “name” : “John”,  
> }  
> },  
> {  
> “\_index” : “test”,  
> “\_type” : “\_doc”,  
> “\_id” : “2”,  
> “\_score” : 2.0,  
> “\_source” : {  
> “name” : “John”,  
> }  
> },  
> {  
> “\_index” : “test”,  
> “\_type” : “\_doc”,  
> “\_id” : “3”,  
> “\_score” : 2.0,  
> “\_source” : {  
> “job\_description” : “Systems administrator and Linux specialist”  
> }  
> }  
> ]  
> }  
> }  
> Blockquote

---

<div class="post-metadata">

**Author:** ![kris](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/kris/32/2208_2.png) [@kris](https://forum.opensearch.org/u/kris)\
**Post date:** [February 7, 2023, 1:10am UTC](https://forum.opensearch.org/t/problem-with-connectiong-roles/3479/2 "2023-02-07T01:10:54Z")

</div>


