# Topic OP moderation Plugin

**URL:** https://meta.discourse.org/t/topic-op-moderation-plugin/256222
**Category:** Plugin
**Created:** [February 25, 2023, 3:42am UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222 "2023-02-25T03:42:53Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [February 25, 2023, 3:42am UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/1 "2023-02-25T03:42:53Z")

</div>

Continuing the discussion from [Ability for users to act as moderators on their own topic](https://meta.discourse.org/t/ability-for-users-to-act-as-moderators-on-their-own-topic/117526/46):

> [@Ability for users to act as moderators on their own topic](https://meta.discourse.org/t/ability-for-users-to-act-as-moderators-on-their-own-topic/117526/41):
>
> Does anyone still care about this?
> 
> I have a forum that needs this, and I’ve developed a plugin for it - it’s still in active development, but almost all the features mentioned in this topic are already available.
> 
> Anyone willing to try it?
> 
> By the way, its I18n support is not good

This plugin has basically been developed and tested now.

[https://github.com/Lemon-planting-light/user-autonomy-plugin](https://github.com/Lemon-planting-light/user-autonomy-plugin)

# Features

I don’t really like to explain its functions, so I decided to use pictures to illustrate what it can do.

## Users

- It adds a button appears just after topic-admin-button for public topic’s creator
- PM is not supported since I don’t think it’s necessary.  
 ![image](https://global.discourse-cdn.com/meta/original/4X/c/9/6/c96c4de95cd193f5bad1f26fce396334164b5531.png)
- Everyone should apply before gain moderation permissions, but the application can be automatically approved.  
 ![image](https://global.discourse-cdn.com/meta/original/4X/b/f/8/bf8e83b455593c2691b5ba8695fc174277b28cb2.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/a/3/3/a33a76b9a3884caf873b72a0d184861e42aae018.png)
- After application, moderatior buttons would appear.  
 ![image](https://global.discourse-cdn.com/meta/original/4X/4/c/3/4c3e1da409e2145505e02a1175a8f96bc06fe2ad.png)

## Manipulating Groups

- This button appears in every topic
- The options below the dividing line will only appear if the user is Staff  
 ![image](https://global.discourse-cdn.com/meta/original/4X/d/6/e/d6e18b328f854dd329b3c63dc3e606efcfa50b1d.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/a/3/7/a37256baf00aa3c46cd5f22b609ad1b72d732c80.png)

## Admins

- It added a whole tab to the settings because it was a bigger plan  
 ![image](https://global.discourse-cdn.com/meta/original/4X/4/a/6/4a62ddd149e470f4c6771cb1494aeded6586404e.png)
- Site settings  
 ![image](https://global.discourse-cdn.com/meta/original/4X/2/2/8/228c3edb7991e7ff206909dfd47b3b6c755795f1.png)
- It will create logs in a special topic  
 ![image](https://global.discourse-cdn.com/meta/original/4X/f/a/5/fa58dd2be4cf9f2cfaff283be3334f9cf1fea371.png)

# Important notes

**After installation, please follow the instructions below before enabling the plugin**

- Before enabling this plugin, you need to create an account to be used as a “User Assistant bot”. Although this plugin can automatically create bot user or use existing `@Discobot`, I don’t recommend doing that, because the bot users created by the plugin cannot be modified in the admin panel. You can grant it any permission you want, because in fact, the relevant code is specially written to make the bot always act as Admin, but I suggest that it is best to grant it Admin or moderator permissions. During development, sometimes unknown bugs that I cannot reproduce stably are caused due to this reason.

- Then, you need to create a topic, which can be a private message or a public topic. Fill in its topic\_id to `SiteSetting.topic_op_admin_logger_topic`. If `topic_op_admin_enable_topic_log` is turned on, the above bot will create more detailed log posts within the topic.

- After creating the user assistant robot, write down its user id, and then fill it in `SiteSetting.topic_op_admin_bot_user_id` above.

- **Opening certain settings without following the above steps correctly can cause errors or even break your website**

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [March 9, 2023, 8:54pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/2 "2023-03-09T20:54:13Z")

</div>

Have you considered seeing if you can tie the bot to category mod group? As full Mod/Admin imho might be risky.

There aree a few plugins that have been on the plugin category marked experimental until it was considered out of development phase like Who’s Online.

Maybe @Canapin can look into category and discuss with you.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [March 9, 2023, 10:07pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/3 "2023-03-09T22:07:21Z")

</div>

Great going, good luck with the development!

> [@Lhc\_fl](#):
>
> I’m not sure what category it should be placed in. Considering it’s still under active development, I put it in #Development

I wonder if we should have “Alpha” and “Beta” tags in #Customization > Plugin? :thinking:

That would make new plugins easier to find and also reflect the risk you would take installing them …

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [March 10, 2023, 1:23am UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/4 "2023-03-10T01:23:19Z")

</div>

> [@Heliosurge](#):
>
> Have you considered seeing if you can tie the bot to category mod group? As full Mod/Admin imho might be risky.

Plugins are code that runs alongside Discourse. It is not a problem for the bot to have any permissions, from Admin to TL0, because in fact it is just an object of code operations, and it has unlimited permissions.

> [@Heliosurge](#):
>
> There aree a few plugins that have been on the plugin category marked experimental until it was considered out of development phase like Who’s Online.

In fact I have now finished developing this part of the plugin. But I’d be wary of publishing this plugin to #Customization > Plugin given the more catastrophic consequences if a plugin (rather than theme component) goes wrong.

I will release it officially after the plugin is launched on my forum and after a period of verification.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [March 20, 2023, 3:02pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/5 "2023-03-20T15:02:37Z")

</div>

This plugin has basically been developed and tested. Now you can install it with confidence!  
(but follow the steps written above:

> [@Lhc\_fl](#):
>
> # Important notes
> 
> **After installation, please follow the instructions below before enabling the plugin**
> 
> - Before enabling this plugin, you need to create an account to be used as a “User Assistant bot”. Although this plugin can automatically create bot user or use existing `@Discobot`, I don’t recommend doing that, because the bot users created by the plugin cannot be modified in the admin panel. You can grant it any permission you want, because in fact, the relevant code is specially written to make the bot always act as Admin, but I suggest that it is best to grant it Admin or moderator permissions. During development, sometimes unknown bugs that I cannot reproduce stably are caused due to this reason.
> - Then, you need to create a topic, which can be a private message or a public topic. Fill in its topic\_id to `SiteSetting.topic_op_admin_logger_topic`. If `topic_op_admin_enable_topic_log` is turned on, the above bot will create more detailed log posts within the topic.
> - After creating the user assistant robot, write down its user id, and then fill it in `SiteSetting.topic_op_admin_bot_user_id` above.
> - **Opening certain settings without following the above steps correctly can cause errors or even break your website**

---

<div class="post-metadata">

### Author: ![orangeandblack5](https://avatars.discourse-cdn.com/v4/letter/o/edb3f5/32.png) [@orangeandblack5](https://meta.discourse.org/u/orangeandblack5)
#### Post date: [April 9, 2023, 6:43pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/6 "2023-04-09T18:43:40Z")

</div>

@Lhc_fl this looks super useful, but does it allow the OP to post on their own topic while it is closed, like a moderator or admin could? To us that seems like a much better flow than making them unlock it, post, and then re-lock it.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [April 9, 2023, 11:40pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/7 "2023-04-09T23:40:47Z")

</div>

I’m planning to add this feature - but I’ve been busy recently and don’t have much time to look at my plugin. Anyone interested can submit a pull request

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [September 26, 2023, 3:30pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/8 "2023-09-26T15:30:38Z")

</div>

@Lhc_fl  
this is a nice plugin,

- possible to make this a theme component ? more folks will be able to use this,  
we don’t have permission to install plugin to the instance, but could install theme component.

- could add the “Split and merge topics” to the permission list ?

thanks…

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [September 26, 2023, 3:55pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/9 "2023-09-26T15:55:07Z")

</div>

> [@fbpbdmin](#):
>
> possible to make this a theme component ?

No, it’s impossible because it needs to interact with the database.

> [@fbpbdmin](#):
>
> could add the “Split and merge topics” to the permission list ?

Maybe, but it’s more difficult. I don’t have the energy to add new features to it recently.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [April 22, 2024, 3:14am UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/10 "2024-04-22T03:14:30Z")

</div>

I’m sorry that this plug-in is incompatible with the new version of discourse due to the upgrade of ember.js, but I am too busy now to fix it. If anyone is willing to fix it, please PR it on Github

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 6, 2024, 12:54pm UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/11 "2024-07-06T12:54:41Z")

</div>

I upgraded this plugin today to adapt to the new version of discourse. Now the plugin is no longer #broken

---

<div class="post-metadata">

### Author: ![whitewaterdeu](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@whitewaterdeu](https://meta.discourse.org/u/whitewaterdeu)
#### Post date: [April 22, 2025, 10:25am UTC](https://meta.discourse.org/t/topic-op-moderation-plugin/256222/12 "2025-04-22T10:25:59Z")

</div>

i have opened `User autonomy plugin enabled` , but there is an error after submitting request

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/5/5/d55db71231769f0a9df613cc0e7f0c53e9f70b9c.png)

this is the log in browser terminal

```plaintext

chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:393 
 SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at D.parse [as parseJSON] (<anonymous>)
    at l (chunk.7b3110aa5b5be8…1d8cd9.js:393:63167)
    at p (chunk.7b3110aa5b5be8…1d8cd9.js:393:63847)
    at k (chunk.7b3110aa5b5be8…41d8cd9.js:308:3688)
    at w (chunk.7b3110aa5b5be8…41d8cd9.js:308:3581)
    at f (chunk.7b3110aa5b5be8…41d8cd9.js:308:3077)
    at invoke (chunk.7b3110aa5b5be8…1d8cd9.js:121:10063)
    at m.flush (chunk.7b3110aa5b5be8…41d8cd9.js:121:9140)
    at g.flush (chunk.7b3110aa5b5be8…1d8cd9.js:121:11012)
    at q._end (chunk.7b3110aa5b5be8…1d8cd9.js:121:16062)
    at q.end (chunk.7b3110aa5b5be8…1d8cd9.js:121:13189)
    at q._run (chunk.7b3110aa5b5be8…1d8cd9.js:121:16576)
    at q.run (chunk.7b3110aa5b5be8…1d8cd9.js:121:13722)
    at c (chunk.7b3110aa5b5be8…1d8cd9.js:161:53419)
    at t.error (chunk.7b3110aa5b5be8…d8cd9.js:302:131483)
    at l (chunk.7b3110aa5b5be8…1d8cd9.js:191:58317)
    at Object.fireWith [as rejectWith] (chunk.7b3110aa5b5be8…1d8cd9.js:191:59062)
    at C (chunk.7b3110aa5b5be8…41d8cd9.js:194:5783)
    at XMLHttpRequest.<anonymous> (chunk.7b3110aa5b5be8…41d8cd9.js:194:8211)
l	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:393
p	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:393
k	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:308
w	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:308
f	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:308
invoke	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
flush	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
flush	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_end	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
end	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_run	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
run	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
c	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:161
t.error	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:302
l	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:191
fireWith	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:191
C	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:194
(匿名)	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:194
XMLHttpRequest.send		
send	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:194
ajax	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:194
o	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:302
(匿名)	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:308
e	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:308
D	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:302
submit	@	request-op-admin-form.js:106
(匿名)	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:421
invoke	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
flush	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
flush	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_end	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
end	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_runExpiredTimers	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
setTimeout		
setTimeout	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_installTimerTimeout	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_reinstallTimerTimeout	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
_later	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
later	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:121
T	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:161
_triggerAction	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:421
click	@	chunk.7b3110aa5b5be8…8f9.d41d8cd9.js:421
﻿

```
