了解用户状态、角色和权限

:bookmark: 本指南旨在帮助理解 Discourse 中各种用户状态、角色和权限,包括它们如何影响用户功能以及在数据库中如何存储。

:person_raising_hand: 所需用户级别:管理员

Discourse 内置了许多用户状态、角色和权限。

在管理后台的“用户”部分查看特定用户的个人资料时,可以看到该用户的这些状态和角色:

权限状态

已激活 (Activated)

账户已验证电子邮件,因此在 Discourse 实例中处于激活状态。

  • 账户可以登录 Discourse,未激活的账户无法登录
  • 未激活的账户只能验证其电子邮件(以及完成注册所必需的其他路由)。

存储users 表中的 active 布尔列

暂存 (Staged)

一种特殊的占位符账户,由系统自动创建用于电子邮件集成。

  • 永远不会发送电子邮件摘要
  • 自动关注其参与的所有消息,并接收回复通知
  • 可以通过电子邮件回复通知
  • 用户名和姓名是自动选择的
  • 账户仍可使用相同的电子邮件注册并“接管”该暂存账户。
  • 无法接收密码重置电子邮件

存储users 表中的 staged 字段

管理员 (Admin)

管理员用户是系统中的超级用户,他们可以:

  • 模拟非管理员用户
  • 更改站点设置
  • 创建群组
  • 修改站点自定义设置
  • 执行版主可以执行的所有操作
  • 阅读任何私信
  • 创建、删除和修改分类
  • 忽略分类权限以查看私密分类

存储users 表中的布尔字段 admin 用于标记任何管理员账户。

版主 (Moderator)

能够管理站点的强力用户:

  • 在帖子名称旁显示盾牌图标
  • 可以执行工作人员(Staff)可以执行的所有操作

存储users 表中的布尔字段 moderator

工作人员 (Staff)

工作人员用户是指任何管理员或版主(或两者皆是)的用户。

  • 不受速率限制
  • 可以处理标记和保留在审核队列中的帖子
  • 可以删除主题和帖子、拆分主题、合并主题、隐藏主题等。
  • 可以查看用户信息(版主除外,版主无法查看电子邮件)
  • 可以暂停、禁言、匿名化和删除用户
  • 可以调整用户的信任级别

存储:根据 users 表中的 adminmoderator 列计算得出

分类版主 (Category Moderator)

这是一种非工作人员用户,属于被授予特定分类管理权限的群组。可以通过 enable category group moderation 管理员设置按站点启用,并在分类扳手(Wrench)的设置选项卡中为每个分类进行设置:

信任级别 0 - 4

参见:用户信任级别的作用是什么?

存储users 表中的数字字段 trust_level

已暂停 (Suspended)

账户已从 Discourse 实例中暂停

  • 在用户页面上显示一条注释,说明暂停原因
  • 不允许登录
  • 账户只能被工作人员提及
  • 不会向用户发送任何通知(摘要、消息等)的电子邮件
  • 作为例外,由工作人员发起的任何电子邮件仍会发送给用户

存储users 表中的 suspended_till 日期时间列

已禁言 (Silenced)

无论是由工作人员手动操作,还是当账户被垃圾邮件系统标记为问题账户时,所有发帖功能均被禁用。

  • 账户不能回复任何主题
  • 账户不能创建任何主题
  • 账户不能创建私信,但可以回复私信
  • 账户不能创建标记
  • 账户仍然可以点赞和收藏
  • 账户仍然可以更改用户偏好和“关于我”(这是否是好主意待定)
  • 邮件列表模式停止工作

存储users 表中的 silenced_till 日期时间列


其他状态

用户可能拥有一些未在管理后台权限部分显示的额外状态。

新用户 (New user)

用于使用第一天或新账户的特殊受限账户。new_users 在站点设置中定义了特殊的速率限制。

  • 在过去 24 小时内创建的信任级别 1 账户,或信任级别 0
  • 非工作人员账户

限制:

  • 每 30 秒只能创建一个帖子(rate_limit_new_user_create_post)

存储:根据 users 表中的 created_atmoderatoradmintrust_level 列计算得出

首日用户 (First day user)

适用于用户首次发帖后 24 小时内的特殊额外限制。

  • 尚未发帖,或首次发帖是在 24 小时前创建的
  • 非工作人员账户
  • 不是 TL2 或更高

限制:

  • 最多只能创建 10 个回复(max_replies_in_first_day)
  • 最多只能创建 3 个主题(max_topics_in_first_day)

存储:根据 user_stats 表中的 first_post_created_at,以及 users 表中的 moderatoradmintrust_level 列计算得出

已批准 (Approved)

如果启用了站点设置 must_approve_users,用户在允许登录之前必须被 approved(批准)。

存储users 表中的 approved 布尔列

开发者 (Developer)

用于安装 Discourse 的特殊账户

:spiral_notepad: 此状态仅在自托管安装中可用。

  • 查看显示页面时序的 rack-mini-profiler
  • 模拟任何账户,包括管理员
  • 自动成为管理员并拥有所有管理员权限

存储:通过 developer_emails 全局设置或 developers 表控制,在 Docker 安装中使用环境变量 DISCOURSE_DEVELOPER_EMAILS 来指定开发者用户的电子邮件列表。

附加资源

若要详细了解授予分类版主的具体权限,请参阅 Trust Level Permissions Reference

90 个赞
Modifying Staff Roles to go beyond Administrator and Moderator?
List of full moderation tools?
Deactivating users permanently
Improving Blocked User State
Which setting(s) would prevent Discourse from emailing an old user?
View Forum as User X
What permissions can admins give moderators?
How i can manage roles for moderators and administrators?
Levels and Staff roles
A new trust level: The Helpful member?
How to disable mail for staged users?
Discourse User Roles difference
Understading groups in discourse
Suspend all users apart from admin users for development copy
Who is able to change profile of another user
How do I block a user?
How does discourse count users?
A single number for users ranking (reputation like)?
Allow moderators to create groups
What is a staged user?
Discourse User Features
How to activate users after a large import of mbox archives
Disable DM visibility from Admins
Understanding Discourse Trust Levels
What are "staged users"?
Additional admins & moderators / staff users on pricing page
Trying to understand "staff" slots and moderation in hosted plans
Promoting a User to Admin or Moderator Status
Moderators vs Staff
Adding users to the developers table
Error adding a backup email address: address already in use by a staged user
Trying to understand "staff" slots and moderation in hosted plans
Create staged users via API?
Admin ability to impersonate other admin differs between admins
My Wiki of useful Meta (and other) links
TOC missing after using browsers back button
Proposed: allow moderators to silence, not delete users flagged by akismet
Incorrect account stats
How to reply to staged user through discourse?
Daily Summary (9pm UTC)
Improving Blocked User State
Users who are 'activated' but not 'approved'
Why are system and super admin both mod and admin?
Why are system and super admin both mod and admin?
Does the 'Posted' field in the user card include topics in private categories?
Unlisted option on creation of a new topic
Improving Blocked User State
Are banned members supposed to receive email notifications?
What is a staff user on hosted Discourse?
Limit the daily number of posts from a user
Major slowdown for staff in large topics
For how long a new user is considered "new user"?
How to invite someone to answer a question?
Auto-remove accounts when SSO ID is not longer valid
Best strategy for member who wants to "pause"? Suspend may not be it
How might we better structure #howto?
Send email to non registered user in a group
Difference between “member” and “staff user”
Send email to non registered user in a group
New pending application generates staff notification
Change user registration date (created_at) via API
Please update 'Understanding Discourse Trust Levels' — or is there a different doc?
When you started your first Discourse community, what did you find hard to do?
Can I enforce Slow Mode on a per-user basis or limit their comments?
Understanding Discourse Trust Levels
Watch topic using email address without requiring registration
Can T4 members access personally identifiable information?
How to get an API key