2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00
discourse/app/serializers/admin_detailed_user_serializer.rb
Sam Saffron 85973ce6b0 added delete all posts button
wired up the ability to enable all themes
2013-02-07 18:11:56 +11:00

32 lines
718 B
Ruby

class AdminDetailedUserSerializer < AdminUserSerializer
attributes :moderator,
:can_grant_admin,
:can_impersonate,
:can_revoke_admin,
:like_count,
:post_count,
:flags_given_count,
:flags_received_count,
:private_topics_count,
:can_delete_all_posts
has_one :approved_by, serializer: BasicUserSerializer, embed: :objects
def can_revoke_admin
scope.can_revoke_admin?(object)
end
def can_grant_admin
scope.can_grant_admin?(object)
end
def can_delete_all_posts
scope.can_delete_all_posts?(object)
end
def moderator
object.has_trust_level?(:moderator)
end
end