mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't show move topic for private messages for TL4 (#28871)
In TopicController, in addition to ensure_can_move_posts!, we also checked if the topic is private message in this line: ```ruby raise Discourse::InvalidAccess if params[:archetype] == "private_message" && !guardian.is_staff? ``` However, this was not present in `guardian.can_move_posts?`. As a result, the frontend topic view got an incorrect serialized result, thinking that TL4 could move the private message post. In fact, once they tried to move it, they got the `InvalidAccess` error message. This commit fixes that TL4 will no longer sees the "move to" option in the "select post" panel for a private message.
This commit is contained in:
@@ -875,8 +875,6 @@ class TopicsController < ApplicationController
|
||||
params.permit(:chronological_order)
|
||||
params.permit(:archetype)
|
||||
|
||||
raise Discourse::InvalidAccess if params[:archetype] == "private_message" && !guardian.is_staff?
|
||||
|
||||
topic = Topic.with_deleted.find_by(id: topic_id)
|
||||
guardian.ensure_can_move_posts!(topic)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user