Only show delete user button on post approvals for TL0

This commit is contained in:
Robin Ward 2015-05-19 12:19:25 -04:00
parent f496982e79
commit 8f0cd18d4b
2 changed files with 17 additions and 6 deletions

View file

@ -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"

View file

@ -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