# Make custom plugin available based on role of user and in some namepsaces only

**URL:** <https://discuss.elastic.co/t/make-custom-plugin-available-based-on-role-of-user-and-in-some-namepsaces-only/315932>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [October 6, 2022, 5:07am UTC](https://discuss.elastic.co/t/make-custom-plugin-available-based-on-role-of-user-and-in-some-namepsaces-only/315932 "2022-10-06T05:07:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheereen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheereen/32/122005_2.png) [@Sheereen](https://discuss.elastic.co/u/Sheereen)\
**Post date:** [October 6, 2022, 5:07am UTC](https://discuss.elastic.co/t/make-custom-plugin-available-based-on-role-of-user-and-in-some-namepsaces-only/315932/1 "2022-10-06T05:07:38Z")

</div>

Hi

I am creating a custom externally distributable plugin  
But I want the plugin to be installed in specific namespaces only and be available to users with specific roles only  
How can I implement it?

I checked on Kibana browser, but there I could find restricting access to indices only, and nothing about custom plugins. I believe I'll have to make some changes when installing plugins or in the code for registering the plugin on to the side navigation bar.  
Please guide me.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [October 6, 2022, 7:53am UTC](https://discuss.elastic.co/t/make-custom-plugin-available-based-on-role-of-user-and-in-some-namepsaces-only/315932/2 "2022-10-06T07:53:00Z")

</div>

You can hook into permission management from your custom plugin and have it show up in the configuration form for privileges for roles. E.g. see how the infra plugin is doing it (to pick an arbitrary example):

> <https://github.com/elastic/kibana/blob/3fa154292b42b7196015d0ff8cac23fc6d8fe0a3/x-pack/plugins/infra/server/plugin.ts#L177>

> <https://github.com/elastic/kibana/blob/3fa154292b42b7196015d0ff8cac23fc6d8fe0a3/x-pack/plugins/infra/server/features.ts#L19>

---

<div class="post-metadata">

**Author:** ![Sheereen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheereen/32/122005_2.png) [@Sheereen](https://discuss.elastic.co/u/Sheereen)\
**Post date:** [October 25, 2022, 10:51am UTC](https://discuss.elastic.co/t/make-custom-plugin-available-based-on-role-of-user-and-in-some-namepsaces-only/315932/3 "2022-10-25T10:51:51Z")

</div>

> **[Security | Kibana Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/kibana/current/development-security.html#development-plugin-feature-registration)**
>
> Conceptual and step-by-step procedures for using runtime fields, scripted fields, and field formatters.

---

<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 22, 2022, 10:52am UTC](https://discuss.elastic.co/t/make-custom-plugin-available-based-on-role-of-user-and-in-some-namepsaces-only/315932/4 "2022-11-22T10:52:35Z")

</div>

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