[PR #1247] [MERGED] Implement admin ability to enable/disable users #2928

Closed
opened 2026-03-03 09:08:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/1247
Author: @janost
Created: 11/30/2020
Status: Merged
Merged: 12/8/2020
Merged by: @dani-garcia

Base: masterHead: admin-disable-user


📝 Commits (2)

  • 043aa27 Implement admin ability to enable/disable users
  • b32f445 Merge branch 'master' into admin-disable-user

📊 Changes

13 files changed (+63 additions, -0 deletions)

View changed files

migrations/mysql/2020-11-30-224000_add_user_enabled/down.sql (+0 -0)
migrations/mysql/2020-11-30-224000_add_user_enabled/up.sql (+1 -0)
migrations/postgresql/2020-11-30-224000_add_user_enabled/down.sql (+0 -0)
migrations/postgresql/2020-11-30-224000_add_user_enabled/up.sql (+1 -0)
migrations/sqlite/2020-11-30-224000_add_user_enabled/down.sql (+0 -0)
migrations/sqlite/2020-11-30-224000_add_user_enabled/up.sql (+1 -0)
📝 src/api/admin.rs (+21 -0)
📝 src/api/identity.rs (+8 -0)
📝 src/db/models/user.rs (+2 -0)
📝 src/db/schemas/mysql/schema.rs (+1 -0)
📝 src/db/schemas/postgresql/schema.rs (+1 -0)
📝 src/db/schemas/sqlite/schema.rs (+1 -0)
📝 src/static/templates/admin/users.hbs (+26 -0)

📄 Description

Feature request from #246.

This change implements the following:

  • New bool flag on the users table: enabled with default value of true.
  • 2 new admin endpoints:
    • /admin/users/<uuid>/enable
    • /admin/users/<uuid>/disable
  • Check during login if the user is disabled and refuse login
  • Add Disabled badge and enable/disable user links on admin page

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/1247 **Author:** [@janost](https://github.com/janost) **Created:** 11/30/2020 **Status:** ✅ Merged **Merged:** 12/8/2020 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `admin-disable-user` --- ### 📝 Commits (2) - [`043aa27`](https://github.com/dani-garcia/vaultwarden/commit/043aa27aa36f3918ad273eb67068cc0dc925dfb4) Implement admin ability to enable/disable users - [`b32f445`](https://github.com/dani-garcia/vaultwarden/commit/b32f4451eecf3c2a6f7ff938c3343cb2f5bde6ef) Merge branch 'master' into admin-disable-user ### 📊 Changes **13 files changed** (+63 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `migrations/mysql/2020-11-30-224000_add_user_enabled/down.sql` (+0 -0) ➕ `migrations/mysql/2020-11-30-224000_add_user_enabled/up.sql` (+1 -0) ➕ `migrations/postgresql/2020-11-30-224000_add_user_enabled/down.sql` (+0 -0) ➕ `migrations/postgresql/2020-11-30-224000_add_user_enabled/up.sql` (+1 -0) ➕ `migrations/sqlite/2020-11-30-224000_add_user_enabled/down.sql` (+0 -0) ➕ `migrations/sqlite/2020-11-30-224000_add_user_enabled/up.sql` (+1 -0) 📝 `src/api/admin.rs` (+21 -0) 📝 `src/api/identity.rs` (+8 -0) 📝 `src/db/models/user.rs` (+2 -0) 📝 `src/db/schemas/mysql/schema.rs` (+1 -0) 📝 `src/db/schemas/postgresql/schema.rs` (+1 -0) 📝 `src/db/schemas/sqlite/schema.rs` (+1 -0) 📝 `src/static/templates/admin/users.hbs` (+26 -0) </details> ### 📄 Description Feature request from #246. This change implements the following: - New bool flag on the `users` table: `enabled` with default value of `true`. - 2 new admin endpoints: - `/admin/users/<uuid>/enable` - `/admin/users/<uuid>/disable` - Check during login if the user is disabled and refuse login - Add `Disabled` badge and enable/disable user links on admin page --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:08:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#2928
No description provided.