mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
moderators now have teeth, more at http://meta.discourse.org/t/moderator-permission-set/6307/5
allow pms to be targetted at groups
This commit is contained in:
@@ -15,8 +15,15 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
|
||||
# we probably want to move this into site, but that json is cached so hanging it off current user seems okish
|
||||
|
||||
def moderator
|
||||
# TODO we probably want better terminology
|
||||
#
|
||||
# we have admins / moderators and users who are either moderators or admins denoted by moderator?
|
||||
object.moderator?
|
||||
end
|
||||
|
||||
def include_site_flagged_posts_count?
|
||||
object.admin
|
||||
object.moderator?
|
||||
end
|
||||
|
||||
def topic_count
|
||||
|
||||
@@ -88,7 +88,7 @@ class PostSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def cooked
|
||||
if object.hidden && !scope.is_admin?
|
||||
if object.hidden && !scope.is_moderator?
|
||||
if scope.current_user && object.user_id == scope.current_user.id
|
||||
I18n.t('flagging.you_must_edit')
|
||||
else
|
||||
@@ -154,7 +154,7 @@ class PostSerializer < ApplicationSerializer
|
||||
|
||||
# The following only applies if you're logged in
|
||||
if action_summary[:can_act] && scope.current_user.present?
|
||||
action_summary[:can_clear_flags] = scope.is_admin? && PostActionType.flag_types.values.include?(id)
|
||||
action_summary[:can_clear_flags] = scope.is_moderator? && PostActionType.flag_types.values.include?(id)
|
||||
end
|
||||
|
||||
if post_actions.present? && post_actions.has_key?(id)
|
||||
@@ -163,7 +163,7 @@ class PostSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
# anonymize flags
|
||||
if !scope.is_admin? && PostActionType.flag_types.values.include?(id)
|
||||
if !scope.is_moderator? && PostActionType.flag_types.values.include?(id)
|
||||
action_summary[:count] = action_summary[:acted] ? 1 : 0
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user