# 为非版主管理员添加不显示标记通知的设置

**URL:** <https://meta.discourse.org/t/add-setting-to-not-show-flag-notification-to-admins-who-are-not-moderators/383964>\
**Category:** Feature\
**Tags:** review-queue\
**Created:** [2025年九月25日 00:10 UTC](https://meta.discourse.org/t/add-setting-to-not-show-flag-notification-to-admins-who-are-not-moderators/383964 "2025-09-25T00:10:51Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2026年七月9日 05:27 UTC](https://meta.discourse.org/t/add-setting-to-not-show-flag-notification-to-admins-who-are-not-moderators/383964/7 "2026-07-09T05:27:37Z")

</div>

所以，纯粹为了好玩——我在这里开了一个 PR，让所有标记通知仅发送给 `Moderators`（版主）组的成员（即上面的选项 B）。因此，不属于 `Moderators` 组的 `Admins`（管理员）将不会收到任何标记通知或指示。当然，他们随时仍可以通过侧边栏进入审核队列。

我预计一些 PR 测试会像往常一样失败，可能是 linting（代码风格检查）的问题。哈哈。

我的老伙计 `triage-bot` 大概能搞定 😉

> <https://github.com/discourse/discourse/pull/41580>
>
> \## What is the purpose of this Pull Request?
> Currently, Discourse broadcasts re…view queue notifications (flags, queued posts) to the entire \`staff\` group. This results in significant notification noise for "pure Admins" who are not members of the Moderator group, and thus, not involved in the day-to-day moderation of the community. 
> 
> Following the discussion on Meta here: https://meta.discourse.org/t/add-setting-to-not-show-flag-notification-to-admins-who-are-not-moderators/383964/5
> 
> This PR makes flags only notify the Moderators group instead of staff; thus, Admins not in the moderators group are not notified of flags nor see a review queue count indicator in sidebar (they can still go to the review queue manually as usual). That is, it mutes the active UI elements for pure Admins while preserving their underlying permission to access and action the review queue if they choose to. 
> 
> \### Technical Implementation:
> This PR intercepts the reviewable counts at the Model and Serializer layers to securely silence the frontend without modifying underlying database permissions or the core \`/review\` route.
> 
> 1. \*\*Websockets & Live Updates:\*\* 
> \* Scoped \`notify\_users\` to \`moderators\` instead of \`staff\` to prevent live browser "pops" for admins.
> \* Updated \`publish\_reviewable\_counts\` to push \`0\` counts to pure admins.
> 2. \*\*UI Badges & Preloaders:\*\*
> \* Overrode \`unseen\_reviewable\_count\` and \`reviewable\_count\` in \`CurrentUserSerializer\` to clear the red avatar flag, the blue menu badge, and the sidebar count for pure admins.
> \* Intercepted \`Reviewable.user\_menu\_list\_for\` to return an empty array for non-moderators, effectively silencing the \`\<meta\>\` tag preloader and the user menu dropdown API.
> 3. \*\*Tests:\*\* Updated \`refresh\_users\_reviewable\_counts\_spec\` to expect \`0\` for admin payloads. \*(Note: CI is running, will update any other strictly \`staff\`-scoped spec expectations as needed!)\*
> 
> \### Testing Performed:
> Manually verified on a live development install with three distinct user roles:
> \- \[x\] \*\*Pure Admin (Admin = true, Moderator = false):\*\* Receives 0 websocket pops, no red avatar badge, no blue menu badge, and an empty menu dropdown. Can still successfully manually navigate to \`/review\` and action pending flags.
> \- \[x\] \*\*Pure Moderator (Admin = false, Moderator = true):\*\* Behavior remains exactly as it was. Fully receives websockets, badges, and dropdown items.
> \- \[x\] \*\*Hybrid Staff (Admin = true, Moderator = true):\*\* Behavior remains exactly as it was (receives all notifications).
> \- \[\] \*\*Category Moderators:\*\* not tested yet.
> 
> \### Files Touched:
> \* app/models/reviewable.rb
> \* app/models/user.rb
> \* app/serializers/current\_user\_serializer.rb
> \* app/controllers/reviewables\_controller.rb
> \* spec/jobs/refresh\_users\_reviewable\_counts\_spec.rb
> \* spec/requests/reviewables\_controller\_spec.rb

编辑：抱歉 Moin，我不在乎类别版主 😆

---

_[View the full topic](https://meta.discourse.org/t/add-setting-to-not-show-flag-notification-to-admins-who-are-not-moderators/383964)._
