# Moderator Extension

**URL:** https://meta.discourse.org/t/moderator-extension/67305
**Category:** Plugin
**Tags:** deprecated
**Created:** [August 2, 2017, 10:15am UTC](https://meta.discourse.org/t/moderator-extension/67305 "2017-08-02T10:15:17Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [August 2, 2017, 10:15am UTC](https://meta.discourse.org/t/moderator-extension/67305/1 "2017-08-02T10:15:17Z")

</div>

**This Plugin is no longer supported. If you’re looking to do category-specific moderation, please see: [Category Group Review/Moderation](https://meta.discourse.org/t/category-group-review-moderation/116478)**

[https://github.com/angusmcleod/discourse-category-moderator-lite](https://github.com/angusmcleod/discourse-category-moderator-lite)

This plugin allows you to create a category-specific workflow for moderators. It’s a work in progress. I’m posting it here now, as there are probably aspects to moderation I don’t understand or appreciate and I’m hoping to get some feedback.

**This plugin does not, in any way, restrict a moderator’s powers to specific categories.**

Restricting moderator powers to a particular category is the subject of [this specification](https://meta.discourse.org/t/category-specific-moderators-phase-1-rfc/21900). If it is to be done, it will be done by the Discourse team, as it would be far too complex and unsustainable to do in a plugin.

I have said a bit more about why I think this plugin makes sense [here](https://meta.discourse.org/t/category-specific-moderators-phase-1-rfc/21900/58). In short, for my purposes at least, if I were worried that a category-specific moderator would ‘overstep their bounds’, then they probably shouldn’t be a moderator anyway.

For me, category-specific moderation is more about focusing a moderator’s _attention_ on a particular category. This more limited goal can be achieved much more easily than full-blown restriction.

Current implementation:

1. Allows moderators to be assigned to a category in the category settings.  

2. When a moderator is assigned to a category:

To do:

- ~~Apply the same treatment to Post Approval, i.e. create a separate count and make a distinction between assigned-category and ‘All’ in `/queued-posts`.~~

- ~~Update the email reminders for flags and post approvals so that moderators assigned to a category do not get reminders about flags and posts outside of their category.~~

- Probably more. Suggestions welcome.

Feedback and pull requests are very welcome. Moderation is a significant responsibility that I know little about.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [September 21, 2017, 8:47am UTC](https://meta.discourse.org/t/moderator-extension/67305/2 "2017-09-21T08:47:12Z")

</div>

I’ve updated this plugin in the following ways:

- There is now also a separate count and list for queued posts if a moderator is assigned to a category.

- Moderators who are _not_ assigned to a category are automatically added to a group `site_moderators` (if they are removed as mods or they become category mods, they are automatically removed). This makes it possible to target a message at non-category moderators

- Category moderators are not sent the general `PendingFlagsReminder` and the `PendingQueuedPostReminder` (these are sent to `site_moderators` instead)

The remaining to dos here are:

- Sending category-specific `PendingFlagsReminder` and `PendingQueuedPostReminder` to category mods in place of the generic ones (which they are now excluded from)

- Test suite.

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [October 18, 2017, 5:44pm UTC](https://meta.discourse.org/t/moderator-extension/67305/3 "2017-10-18T17:44:07Z")

</div>

I get this error when trying to install this plugin:

```plaintext
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 11026 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
dfd86aaa082d94631432802052927e243786c185ef6483319295d21158c728a8
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

FULL LOG: [Discourse Log - Pastebin.com](https://pastebin.com/mRTgdCfY)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [October 19, 2017, 12:59am UTC](https://meta.discourse.org/t/moderator-extension/67305/4 "2017-10-19T00:59:12Z")

</div>

Thanks. It should bootstrap now.

[https://github.com/angusmcleod/discourse-category-moderator-lite/commit/a456016a65d1b9a5472898f122f3962f962764ab](https://github.com/angusmcleod/discourse-category-moderator-lite/commit/a456016a65d1b9a5472898f122f3962f962764ab)

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [November 2, 2017, 8:57pm UTC](https://meta.discourse.org/t/moderator-extension/67305/5 "2017-11-02T20:57:11Z")

</div>

@angus Your plugin is broken 😓

Check this topic:

> [@Error: There is no route named adminFlags.list](https://meta.discourse.org/t/error-there-is-no-route-named-adminflags-list/73303/5):
>
> The only plugin that I see that use “flags” is git clone https://github.com/angusmcleod/discourse-category-moderator-lite.git. Try to disable it first and then make a rebuild.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [November 3, 2017, 4:36am UTC](https://meta.discourse.org/t/moderator-extension/67305/6 "2017-11-03T04:36:07Z")

</div>

Thanks for the heads up. It looks like the admin flags routes have been refactored.

[https://github.com/angusmcleod/discourse-category-moderator-lite/commit/5a7668c5d62eaa7ae07abb5115b6fd609b06182d](https://github.com/angusmcleod/discourse-category-moderator-lite/commit/5a7668c5d62eaa7ae07abb5115b6fd609b06182d)

I’ve fixed the issue and tweaked the UX a bit too. There’s no separate category list now. A moderator assigned to a category just sees flagged posts and topics from their assigned category within the context of the normal flag lists.

 ![Screenshot at Nov 03 12-34-31](https://global.discourse-cdn.com/meta/original/3X/c/5/c5e02862cdeac9479cb757a3d257bec82f2e0d89.jpg)

(screenshot taken on my sandbox where plugin is live and working)

---

<div class="post-metadata">

### Author: ![Heather\_Dudley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heather_dudley/32/151925_2.png) [@Heather\_Dudley](https://meta.discourse.org/u/Heather_Dudley)
#### Post date: [February 22, 2018, 5:34pm UTC](https://meta.discourse.org/t/moderator-extension/67305/7 "2018-02-22T17:34:35Z")

</div>

Thank you so much for this. This is _exactly_ the plugin I need for my forum. We’re in the early stages of development, and haven’t implemented Discourse on our site yet, but I have the same needs as you. I don’t _mind_ my moderators helping outside of their assigned categories, but I do need their attention on the right places.

I will be following this closely.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [February 23, 2018, 1:06pm UTC](https://meta.discourse.org/t/moderator-extension/67305/8 "2018-02-23T13:06:50Z")

</div>

Great! The main thing this plugin needs to move forward is testing and input from someone who really needs it.

If you have the time, you could help me test it on my sandbox.

I’ve made two new categories:

- [https://discourse.angusmcleod.com.au/c/catmod1](https://discourse.angusmcleod.com.au/c/catmod1)

- [https://discourse.angusmcleod.com.au/c/catmod2](https://discourse.angusmcleod.com.au/c/catmod2)

If you could sign up two accounts on my [sandbox](https://discourse.angusmcleod.com.au/), I’ll make each a category moderator in one of those categories, then flag and queue some posts in both with some dummy accounts.

---

<div class="post-metadata">

### Author: ![ewanly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ewanly/32/62854_2.png) [@ewanly](https://meta.discourse.org/u/ewanly)
#### Post date: [February 26, 2018, 5:57am UTC](https://meta.discourse.org/t/moderator-extension/67305/9 "2018-02-26T05:57:46Z")

</div>

I did installed your plugin and its work fine thank you for a great job 🎉

1. When I visit the Settings/Groups and click on the Automatic tab, I could see that I have 19 site\_moderators which is wrong. But when I click on site\_moderators it’s showing the right number which is 2. I could replicate this every time I enter Automatic tab. ( I think something small need to be fixed)

2. In the Category settings, to be able to assign a user to be a moderator for that category, he has to be granted Moderation in the Users settings. ( I don’t know if its required but this how its worked for me, otherwise I wasn’t able to select that user). But I’ve one case where I was able to give category moderation for a user without Grant Moderation! _-for that I’m confused and I need your opinion & clarification on this, please._

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [February 26, 2018, 3:30pm UTC](https://meta.discourse.org/t/moderator-extension/67305/10 "2018-02-26T15:30:16Z")

</div>

> [@ewanly](#):
>
> When I visit the Settings/Groups and click on the Automatic tab, I could see that I have 19 site\_moderators which is wrong. But when I click on site\_moderators it’s showing the right number which is 2.

Yes, this sounds like a bug, I’ll take a look tomorrow.

> [@ewanly](#):
>
> In the Category settings, to be able to assign a user to be a moderator for that category, he has to be granted Moderation in the Users settings. ( I don’t know if its required but this how its worked for me, otherwise I wasn’t able to select that user).

Yes, this is how it’s meant to work.

> [@ewanly](#):
>
> But I’ve one case where I was able to give category moderation for a user without Grant Moderation!

Interesting! Could you give me some more details on this user (anything different about them?) and what exactly you did (i.e. step by step) to give them category moderation without site moderation.

Thanks!

---

<div class="post-metadata">

### Author: ![Heather\_Dudley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heather_dudley/32/151925_2.png) [@Heather\_Dudley](https://meta.discourse.org/u/Heather_Dudley)
#### Post date: [February 27, 2018, 5:41pm UTC](https://meta.discourse.org/t/moderator-extension/67305/11 "2018-02-27T17:41:53Z")

</div>

Thanks, I’m going to take you up on that!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [February 28, 2018, 12:57pm UTC](https://meta.discourse.org/t/moderator-extension/67305/12 "2018-02-28T12:57:26Z")

</div>

We might hang ten on the testing for another day or so. 🏝

I did a deep dive on this plugin today and I’ve completely restructured it to make it more robust and extensible.

I haven’t entirely finished yet. I’ll follow up in the next day or so.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [March 2, 2018, 1:58pm UTC](https://meta.discourse.org/t/moderator-extension/67305/13 "2018-03-02T13:58:21Z")

</div>

I’ve done a significant reworking of this plugin. I’ve changed it’s name to “Moderator Extension” to reflect a change of scope to include a variety of modifications to moderator functionality.

@hawk or @jomaxro could you update the topic title to “Moderator Extension”? Thanks.

[https://github.com/angusmcleod/discourse-moderator-extension/commit/098adbba5159fe5ad47edc1ec0284a7768daaa42](https://github.com/angusmcleod/discourse-moderator-extension/commit/098adbba5159fe5ad47edc1ec0284a7768daaa42)

The highlights of the changes are:

- All moderator administration is now in `/admin/users` in a new “Moderation” section that appears if a user is a moderator. Like other settings in `/admin/users`, admins have read/write permissions and moderators have read permissions.

- Moderators (currently) have two ‘types’: default and filtered. The key attributes of each of type is listed next to the ‘Type’ setting.

- Moderators can now be assigned to multiple categories using the ‘Categories’ setting (see above screenshot). The significance of assignment to a category depends on the moderator type (see above descriptions).

- When category assignments are filtering a moderator action list, like the flag lists, the filtering categories are listed.

- As the description of the types states, all flag and queued post notifications _and_ the reminder messages will reflect the moderator’s category assignments. This was true in the previous version, however this logic has been significantly upgraded to handle assignments to multiple categories.

- You can now display a list of moderators assigned to a category above the topic list(s) for that category. There are both site-wide and category-specific settings for this.

Additional features contemplated:

- ‘Restricted’ Moderator Type. The deeper I got into this plugin, the more ambitious I got. A  
‘restricted’ moderator type feels more doable now that I’ve laid some more of the groundwork. Something like:

- Settings to control which admin routes are available to moderators

- Category-specific moderator groups.

note: @ewanly (any existing moderator category assignments you made will be respected in the new system).

cc @Heather_Dudley

---

<div class="post-metadata">

### Author: ![Heather\_Dudley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heather_dudley/32/151925_2.png) [@Heather\_Dudley](https://meta.discourse.org/u/Heather_Dudley)
#### Post date: [March 2, 2018, 4:09pm UTC](https://meta.discourse.org/t/moderator-extension/67305/14 "2018-03-02T16:09:08Z")

</div>

@angus This looks fantastic. I’m going to get on there today or this weekend and take a good, in-depth look.

---

<div class="post-metadata">

### Author: ![ewanly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ewanly/32/62854_2.png) [@ewanly](https://meta.discourse.org/u/ewanly)
#### Post date: [March 10, 2018, 6:44am UTC](https://meta.discourse.org/t/moderator-extension/67305/17 "2018-03-10T06:44:49Z")

</div>

I just had a chance to go through the changed plugin. Thank you @angus for all of your works and deep thoughts 👼

> [@angus](#):
>
> Powers concerning categories, topics, users and posts are restricted to assigned categories.

In my use case, this will be the most important aspect and the main reason why I would use this plugin. I believe it will bring huge new use-cases to Discourse. I wish we could have it soonest 🙏

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [March 29, 2018, 10:01pm UTC](https://meta.discourse.org/t/moderator-extension/67305/18 "2018-03-29T22:01:25Z")

</div>

I think this plugin is broken  
“IP Lookup” button doesn’t work, same as dropdown

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/e/ae21fbe1a8b80444c64b4678983f4b55af275def.png)  
 ![image](https://global.discourse-cdn.com/meta/original/3X/2/b/2b1cacd0756af87bc53986e17ae770f7e6fc79b2.png)

With [safe mode](https://meta.discourse.org/t/53504?silent=true) it was working

* * *

I’ve disabled it and waiting for Discourse to compile, but logs pointed to this plugin

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/b/ebddb3df7468c3c233c29348d058a95e4f4d058c.png)

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [March 29, 2018, 10:18pm UTC](https://meta.discourse.org/t/moderator-extension/67305/19 "2018-03-29T22:18:49Z")

</div>

Confirmed: I removed the plugin and now works

It seems like the plugin breaks the admin profile of moderators

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [March 30, 2018, 12:04am UTC](https://meta.discourse.org/t/moderator-extension/67305/20 "2018-03-30T00:04:04Z")

</div>

Thanks for the bug report. This is now fixed.

[https://github.com/angusmcleod/discourse-moderator-extension/commit/def9540af76be1db89a130fcdc2d240f3df406e5](https://github.com/angusmcleod/discourse-moderator-extension/commit/def9540af76be1db89a130fcdc2d240f3df406e5)

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [April 3, 2018, 11:23am UTC](https://meta.discourse.org/t/moderator-extension/67305/21 "2018-04-03T11:23:33Z")

</div>

Having a bit of an issue with this. When I go to a category that has this enabled and moderators added, the “Moderators” text and avatars don’t appear without a page refresh. After that, they persist when I visit the index, until I refresh again. I only have “display moderators” enabled for a single category.

Anyone else experienced this? Could it be caused by incompatibility with another plugin perhaps? I installed a few at once but don’t see any errors in the logs so I don’t have much to go on besides guessing and checking.

Edit: Enabled it for a bunch more categories (all those that have moderators), issue persists. Doesn’t have to do with that. The setting also stays until a page reload when I switch from a category with this enabled to one with it disabled. Some kind of caching issue?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 4, 2018, 8:35am UTC](https://meta.discourse.org/t/moderator-extension/67305/22 "2018-04-04T08:35:08Z")

</div>

hm sounds like a property is not being properly observed. I’ll take a look at this tomorrow.

[Next page](https://meta.discourse.org/t/moderator-extension/67305.md?page=2)
