# Hide features for non-admin users through plugin

**URL:** https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973
**Category:** Development
**Created:** [July 29, 2016, 4:15pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973 "2016-07-29T16:15:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gingerman](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@gingerman](https://meta.discourse.org/u/gingerman)
#### Post date: [July 29, 2016, 4:15pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973/1 "2016-07-29T16:15:10Z")

</div>

tldr: I would like to hide certain features in the page & api backend for non-admin users.

For example,  
_I would like to show the list of liked users only for admin users and not for everyone_. The count can be seen by everyone but not the list of users.

Of course this is just an example for my specific need. I am sure this feature will not enter in the core but how could I implement this as a plugin ? I would be interested to know about the api overrides (especially) & UI overrides through plugins.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 29, 2016, 4:20pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973/2 "2016-07-29T16:20:04Z")

</div>

I suggest reading the wonderful series on plugins by @eviltrout, it starts here:

> [@Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins/30515):
>
> Building a plugin in Discourse can be really simple, once you learn a couple of quirks. The goal of this post is to create a skeleton plugin and introduce you to the basics. Your development environment Make sure you have a development environment of Discourse running on your computer. I recommend you use [the appropriate setup guide](https://meta.discourse.org/tag/dev-install) and come back when you’re done. plugin.rbtada Use [GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins · GitHub](https://github.com/discourse/discourse-plugin-skeleton) to create a complete di…

After read some official plugins on [Discourse github page](https://github.com/discourse).

Then go trough some plugins on the #Customization > Plugin category and dig trough their codebase.

---

<div class="post-metadata">

### Author: ![gingerman](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@gingerman](https://meta.discourse.org/u/gingerman)
#### Post date: [July 29, 2016, 4:21pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973/3 "2016-07-29T16:21:27Z")

</div>

Thanks @Falco.. Just want to quickly check if plugins can be used to control features in API as well ?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 29, 2016, 4:22pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973/4 "2016-07-29T16:22:29Z")

</div>

You can monkeypatch classes so yes. Some stuff is easier than others, tough.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 29, 2016, 4:35pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973/5 "2016-07-29T16:35:40Z")

</div>

Though I think this is simply overriding a widget, which shouldn’t be too bad to do.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 29, 2016, 4:39pm UTC](https://meta.discourse.org/t/hide-features-for-non-admin-users-through-plugin/47973/6 "2016-07-29T16:39:46Z")

</div>

Yeah, but if he wants to block this trough API too, it’s more works because the post\_actions is used for more stuff. Doable, but a little more work.
