如何将所有用户提升至信任等级 1?

我们的论坛仅限本组织的付费会员使用,因此垃圾信息似乎不是问题。但不幸的是,由于默认信任级别在达到 50 名用户后会自动切换,目前我们仍有少数用户处于信任级别 0。

是否有办法查找信任级别为 0 的用户并将其提升至信任级别 1?我注意到信任级别为 1 的用户也会出现在信任级别 0 的分组中,因此所有人都属于该分组。谢谢!:slightly_smiling_face:

How many users are we talking about? You can see users who have only Trust Level 1 from the admin report /admin/users/list/newuser. This does not include users with TL1 or higher. From here you can manually up the user’s trust levels. You are correct that all users on the site technically have TL0, even if they also have a greater trust level. If a lot, a rails command is your best bet.

You should also make sure to change the site setting default trust level if you want all users to have TL1.

Thanks! We only had about 7 users at level 0, so it was easy to upgrade them manually. We’ve also set our default trust level to 1, and may even bump it to 2 if users are running into posting limits. I’ll look into the rails commands if we go that route.

@jomaxro For future reference, is there a known way to do this via the command line, or would I have to construct a custom command? Thanks!

Sure! @pfaffman shared some commands in Migrated to Discourse and system is creating hundreds of flagged posts. Backup is always recommended when running potentially destructive commands. Just modify the User.where( command to suit your needs, the rest should be good to go.

你好,
我对一些信任等级为 1 的用户执行了 users.update_all(trust_level: 2)。现在这些用户的信任等级已变为 2:


但他们并未加入相关的群组:

他们稍后会自动被加入该群组吗?是否有需要执行的 Sidekiq 任务?
如果我们在命令行中将用户的信任等级降低(从 4 级降至 2 级),会发生什么情况?

我找到原因了。
触发信任等级组填充的 Sidekiq 任务是 EnsureDbConsistency

在通过命令行更新用户信任等级(无论是提升还是降低)后,EnsureDbConsistency 会将用户移入或移出这些组。