mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Only show delete user button on post approvals for TL0
This commit is contained in:
parent
f496982e79
commit
8f0cd18d4b
2 changed files with 17 additions and 6 deletions
|
@ -61,11 +61,13 @@
|
|||
label="queue.reject"
|
||||
icon="times"
|
||||
class="btn-danger reject"}}
|
||||
{{#if ctrl.post.can_delete_user}}
|
||||
{{d-button action="deleteUser"
|
||||
disabled=ctrl.post.isSaving
|
||||
label="queue.delete_user"
|
||||
icon="trash"
|
||||
class="btn-danger delete-user"}}
|
||||
{{/if}}
|
||||
{{d-button action="edit"
|
||||
disabled=ctrl.post.isSaving
|
||||
label="queue.edit"
|
||||
|
|
|
@ -10,7 +10,8 @@ class QueuedPostSerializer < ApplicationSerializer
|
|||
:raw,
|
||||
:post_options,
|
||||
:created_at,
|
||||
:category_id
|
||||
:category_id,
|
||||
:can_delete_user
|
||||
|
||||
has_one :user, serializer: BasicUserSerializer
|
||||
has_one :topic, serializer: BasicTopicSerializer
|
||||
|
@ -24,4 +25,12 @@ class QueuedPostSerializer < ApplicationSerializer
|
|||
category_id.present?
|
||||
end
|
||||
|
||||
def can_delete_user
|
||||
true
|
||||
end
|
||||
|
||||
def include_can_delete_user?
|
||||
user.trust_level == TrustLevel[0]
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue