mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Don't show the link to "Needs Approval" unless approval is enabled.
Note that any plugin that extends the NewPostMananger to support enqueuing will enable it.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
require_dependency 'new_post_manager'
|
||||
|
||||
class CurrentUserSerializer < BasicUserSerializer
|
||||
|
||||
attributes :name,
|
||||
@@ -27,7 +29,8 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:muted_category_ids,
|
||||
:dismissed_banner_key,
|
||||
:is_anonymous,
|
||||
:post_queue_new_count
|
||||
:post_queue_new_count,
|
||||
:show_queued_posts
|
||||
|
||||
def include_site_flagged_posts_count?
|
||||
object.staff?
|
||||
@@ -116,4 +119,12 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
object.staff?
|
||||
end
|
||||
|
||||
def show_queued_posts
|
||||
true
|
||||
end
|
||||
|
||||
def include_show_queued_posts?
|
||||
object.staff? && NewPostManager.queue_enabled?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user