# How to get only indices list which I have permission

**URL:** <https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 25, 2020, 12:00pm UTC](https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660 "2020-06-25T12:00:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hagun](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@Hagun](https://discuss.elastic.co/u/Hagun)\
**Post date:** [June 25, 2020, 12:00pm UTC](https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660/1 "2020-06-25T12:00:26Z")

</div>

If I have A and B users in my ES.

A can access only a,b,c,d indices. And B can access only e,f,g,h.

In this situation, how can A user get indices list 'a, b, c, d' using ES APi?

If I use \_cat/indices, it returns 403.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 25, 2020, 12:16pm UTC](https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660/2 "2020-06-25T12:16:56Z")

</div>

Welcome!

The `_cat` API is an admin task and requires some cluster privileges.  
But if you run:

```auto
GET /_search

```

User A will only see the content of indices a,b,c,d and User B will only see e,f,g,h.

---

<div class="post-metadata">

**Author:** ![Hagun](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@Hagun](https://discuss.elastic.co/u/Hagun)\
**Post date:** [June 26, 2020, 2:44am UTC](https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660/3 "2020-06-26T02:44:56Z")

</div>

Thanks for your reply.  
I checked GET /a/\_search and it gets information of a index.  
But I want to get [a, b, c] list at once.  
Is "GET /\_search" for that? in my situation it also returns 403.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 26, 2020, 6:01am UTC](https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660/4 "2020-06-26T06:01:11Z")

</div>

Could you try

```
GET /_all/_search

```

May be you need to create aliases and give some read rights to each alias?

---

<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:** [July 24, 2020, 6:01am UTC](https://discuss.elastic.co/t/how-to-get-only-indices-list-which-i-have-permission/238660/5 "2020-07-24T06:01:18Z")

</div>

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