mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 13:03:45 +08:00
FIX: create topic keyboard shortcut not checking permissions
This commit is contained in:
parent
e17ce65aab
commit
e756d02088
|
@ -169,7 +169,9 @@ export default {
|
|||
},
|
||||
|
||||
createTopic() {
|
||||
this.container.lookup('controller:composer').open({action: Composer.CREATE_TOPIC, draftKey: Composer.CREATE_TOPIC});
|
||||
if (this.currentUser && this.currentUser.can_create_topic) {
|
||||
this.container.lookup('controller:composer').open({action: Composer.CREATE_TOPIC, draftKey: Composer.CREATE_TOPIC});
|
||||
}
|
||||
},
|
||||
|
||||
pinUnpinTopic() {
|
||||
|
|
|
@ -38,7 +38,12 @@ class CurrentUserSerializer < BasicUserSerializer
|
|||
:previous_visit_at,
|
||||
:seen_notification_id,
|
||||
:primary_group_id,
|
||||
:primary_group_name
|
||||
:primary_group_name,
|
||||
:can_create_topic
|
||||
|
||||
def can_create_topic
|
||||
scope.can_create_topic?(nil)
|
||||
end
|
||||
|
||||
def include_site_flagged_posts_count?
|
||||
object.staff?
|
||||
|
|
Loading…
Reference in New Issue
Block a user