# How can my plugin access the current users role?

**URL:** <https://discuss.elastic.co/t/how-can-my-plugin-access-the-current-users-role/235837>\
**Category:** Kibana\
**Created:** [June 4, 2020, 6:34pm UTC](https://discuss.elastic.co/t/how-can-my-plugin-access-the-current-users-role/235837 "2020-06-04T18:34:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Gege](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_gege/32/45595_2.png) [@Paul\_Gege](https://discuss.elastic.co/u/Paul_Gege)\
**Post date:** [June 4, 2020, 6:34pm UTC](https://discuss.elastic.co/t/how-can-my-plugin-access-the-current-users-role/235837/1 "2020-06-04T18:34:46Z")

</div>

Hi all,

I'd like to be able to hide my plugin from being seen on the side-nav when a user does not have a certain role configured. How can I access the current user's role through my plugin?

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [June 9, 2020, 3:27am UTC](https://discuss.elastic.co/t/how-can-my-plugin-access-the-current-users-role/235837/2 "2020-06-09T03:27:19Z")

</div>

Hello Paul,

I'm not certain we have a completely ironed out way to do this yet, but I can at least point to an app that's done this, our ML App. This app limits file upload capability based upon a user's roles. The logic they've used requires both a client and a server-side presence. Hope it's of some help!

Regards,  
Aaron

---

<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 7, 2020, 3:27am UTC](https://discuss.elastic.co/t/how-can-my-plugin-access-the-current-users-role/235837/3 "2020-07-07T03:27:24Z")

</div>

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