# 批量批准所有现有用户以便启用“必须批准用户”

**URL:** <https://meta.discourse.org/t/approve-all-existing-users-en-masse-to-facilitate-enabling-must-approve-users/52689>\
**Category:** Product Support\
**Created:** [2016 年11 月 9 日 00:25 UTC](https://meta.discourse.org/t/approve-all-existing-users-en-masse-to-facilitate-enabling-must-approve-users/52689 "2016-11-09T00:25:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![barryvan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barryvan/32/82635_2.png) [@barryvan](https://meta.discourse.org/u/barryvan)\
发布日期： [2016 年11 月 9 日 00:25 UTC](https://meta.discourse.org/t/approve-all-existing-users-en-masse-to-facilitate-enabling-must-approve-users/52689/1 "2016-11-09T00:25:29Z")

</div>

So far, I’ve been running our forum in invite-only mode – which is great. I’d now like to start opening it up a little bit more, such that I can send people to the address to sign up, but require approval of their accounts before they gain access. The “must approve users” setting’s warning is making me a little leery of enabling it, though.

In reading through recent posts here on meta, it looks like:

- Invited users are _not_ considered “approved” by default.
- If I enable this flag, and use the UI to approve each user, they _won’t_ receive “your account has been approved” emails.

What I’d really like to do is approve all the users currently in the system en-masse, and then flip the switch. (I would really, really prefer not to manually approve each user, as I have 140 at the moment.) A couple of questions related to this:

- Can I simply do this by updating the database:

```sql
update users set
  approved = true, approved_by_id = 1, approved_at = current_timestamp
where not approved and active

```

- Is it better to do this via the API? I can’t seem to find an “approve” `def` in [discourse\_api/lib/discourse\_api/api/users.rb at main · discourse/discourse\_api · GitHub](https://github.com/discourse/discourse_api/blob/master/lib/discourse_api/api/users.rb) – just “activate”, which I believe is a different thing altogether.
- Will invited users subsequently be approved by default? Does this vary according to the trust level of the person inviting them?

---

_[View the full topic](https://meta.discourse.org/t/approve-all-existing-users-en-masse-to-facilitate-enabling-must-approve-users/52689)._
