# ה-Back-end מאפשר למודרטורים להשתמש במיזוג/העברת פוסטים להודעה פרטית, אך ה-Front-end לא

**URL:** https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218
**Category:** Support
**Created:** [4 באוקטובר,‏ 2020,‏ 9:17pm UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218 "2020-10-04T21:17:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Hooksmith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hooksmith/32/142826_2.png) [@Hooksmith](https://meta.discourse.org/u/Hooksmith)
#### Post date: [4 באוקטובר,‏ 2020,‏ 9:17pm UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/1 "2020-10-04T21:17:37Z")

</div>

This functionality shows up when you are administrator, but not for moderators:

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/2/327148f6f63e02b6d5a3dd7921b79e5ee8ab2319.png)

The front-end code for this is here:

> <https://github.com/discourse/discourse/blob/52672b9eabccb1184d85dc7f08062d5a7c18cb73/app/assets/javascripts/discourse/app/controllers/move-to-topic.js#L109-L112>

Note the “`this.currentUser.admin`”.

However, the back-end allows for moderators (all staff) to perform this action just fine:

> <https://github.com/discourse/discourse/blob/5cf411c3aec01f48c26e71de5440ff4c0512c266/app/controllers/topics_controller.rb#L709-L715>

> <https://github.com/discourse/discourse/blob/5cf411c3aec01f48c26e71de5440ff4c0512c266/app/controllers/topics_controller.rb#L737-L740>

> <https://github.com/discourse/discourse/blob/9f73e8779d3ae7a1646473d4138a85c3660a58db/lib/guardian/topic_guardian.rb#L205-L220>

* * *

I think the front-end code should be adjusted:

```diff
@discourseComputed("canSplitTopic")
canSplitToPM(canSplitTopic) {
- return canSplitTopic && this.currentUser && this.currentUser.admin;
+ return canSplitTopic && this.currentUser && this.currentUser.staff;
},

```

If you agree with this being a bug I’d be happy to make a PR to fix it. Our moderation team would have need of this fix.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [4 באוקטובר,‏ 2020,‏ 11:02pm UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/2 "2020-10-04T23:02:00Z")

</div>

I’m not sure but it seems plausible. What do you think @techAPJ?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [5 באוקטובר,‏ 2020,‏ 7:16am UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/3 "2020-10-05T07:16:39Z")

</div>

The decision to not show “move to new PM” option for moderators was made explicitly in:

[https://github.com/discourse/discourse/commit/dc2776bcddc07e69e5a4ab92526f6238f3a5ccd7](https://github.com/discourse/discourse/commit/dc2776bcddc07e69e5a4ab92526f6238f3a5ccd7)

This is because the moderators do not have permission to see PMs and the relevant code will fail at:

> <https://github.com/discourse/discourse/blob/310952fd6a2fb74127175486bb0d6723640a274d/app/models/post_mover.rb#L66>

---

<div class="post-metadata">

### Author: ![Hooksmith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hooksmith/32/142826_2.png) [@Hooksmith](https://meta.discourse.org/u/Hooksmith)
#### Post date: [5 באוקטובר,‏ 2020,‏ 12:32pm UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/4 "2020-10-05T12:32:35Z")

</div>

Would it be feasible if a code change is made so that the acting moderator/administrator is added as a recipient on the newly created topic (private message) so that they can see the new topic once it is created? (and would this be a change you folks are interested in receiving?)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [6 באוקטובר,‏ 2020,‏ 2:51am UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/5 "2020-10-06T02:51:38Z")

</div>

I’ll look into the possibility of adding acting moderator as PM recipient and subsequently enabling the feature “move posts to a new PM” for moderators.

---

<div class="post-metadata">

### Author: ![Hooksmith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hooksmith/32/142826_2.png) [@Hooksmith](https://meta.discourse.org/u/Hooksmith)
#### Post date: [6 באוקטובר,‏ 2020,‏ 11:18am UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/7 "2020-10-06T11:18:17Z")

</div>

Great! In case this ends up in backlog / deprioritized and is PR welcome, please let me know and I could help with implementation.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [8 באוקטובר,‏ 2020,‏ 5:50am UTC](https://meta.discourse.org/t/back-end-allows-moderators-to-use-merge-move-posts-to-private-message-but-front-end-does-not/166218/8 "2020-10-08T05:50:19Z")

</div>

It might take a bit for me to get to this. PR is 100% welcome here! 👍
