mirror of
https://github.com/discourse/discourse.git
synced 2025-02-02 14:24:34 +08:00
UX: check category permission before new topic quote (#30753)
Reported here: https://meta.discourse.org/t/quoting-a-closed-topic-prefills-category-in-composer-that-should-be-off-limits/260009 Currently, if someone tries to quote a topic they don't have permission to reply to, we'll open a new topic composer with the quote so they can "continue the discussion". When doing this, we populate the current category, even if the user doesn't have permission to post in it. This is misleading, as when the user attempts to submit their topic they get an error because they lack the category permissions. This change checks the category permissions before populating it.
This commit is contained in:
parent
f8c493f3c4
commit
7330cfa76a
|
@ -1201,7 +1201,9 @@ export default class TopicController extends Controller.extend(
|
|||
options = {
|
||||
action: Composer.CREATE_TOPIC,
|
||||
draftKey: post.topic.draft_key,
|
||||
topicCategoryId: this.get("model.category.id"),
|
||||
topicCategoryId:
|
||||
this.get("model.category.permission") &&
|
||||
this.get("model.category.id"),
|
||||
prioritizedCategoryId: this.get("model.category.id"),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user