# How do we handle admin user with lots of permissions?

**URL:** <https://discuss.elastic.co/t/how-do-we-handle-admin-user-with-lots-of-permissions/230071>\
**Category:** Elastic Search\
**Tags:** elastic-workplace-search\
**Created:** [April 28, 2020, 3:53am UTC](https://discuss.elastic.co/t/how-do-we-handle-admin-user-with-lots-of-permissions/230071 "2020-04-28T03:53:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [April 28, 2020, 3:53am UTC](https://discuss.elastic.co/t/how-do-we-handle-admin-user-with-lots-of-permissions/230071/1 "2020-04-28T03:53:54Z")

</div>

Hi, I am not sure what's the underlying logic of document level permission. I suppose it's something like:

1. get the permission list of current user
2. construct a `terms filter` on field `_allow_permissions `

This search logic is easy for:

1. **super-admin user** : he could read any documents, no permisson filters at all.
2. **normal user** : he could read part of documents, with several permisson filters.

But when it comes a **second level admin user** , things get difficult. Say we have 10,000 unique permissons, he could access 7,000 permissions among. I worry about the performance if we construnct a 7,000 length `terms filter`.

So is there any other delicated design underlying the document level permission logic?

---

<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:** [October 31, 2022, 2:48am UTC](https://discuss.elastic.co/t/how-do-we-handle-admin-user-with-lots-of-permissions/230071/2 "2022-10-31T02:48:06Z")

</div>

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