Fixes some minor issues with users deleting their own posts.

This commit is contained in:
Robin Ward
2013-02-07 16:40:48 -05:00
parent b8ded55450
commit 2d064571df
2 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,12 @@
class CurrentUserSerializer < BasicUserSerializer
attributes :name, :unread_notifications, :unread_private_messages, :admin, :notification_channel_position, :site_flagged_posts_count
attributes :name,
:unread_notifications,
:unread_private_messages,
:admin?,
:notification_channel_position,
:site_flagged_posts_count,
:moderator?
# we probably want to move this into site, but that json is cached so hanging it off current user seems okish
@ -8,6 +14,10 @@ class CurrentUserSerializer < BasicUserSerializer
object.admin
end
def moderator?
object.has_trust_level?(:moderator)
end
def site_flagged_posts_count
PostAction.flagged_posts_count
end