diff options
| author | tv <tv@krebsco.de> | 2026-11-07 22:35:10 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-07 22:35:10 +0100 |
| commit | be988eb1453020804320123fee000edaf3bad03e (patch) | |
| tree | add5db6385733375c3034b4f980c9b383c623876 /src/api/users.rs | |
| parent | 9296dc40640f1c3c039433ccae6e8b8f8c3eb8ae (diff) | |
access: no manages flag
GET /admin/users no longer lists a manages flag per user: whether a
user may manage users follows from its capabilities.
Auth plan M1 (cleanup).
Diffstat (limited to 'src/api/users.rs')
| -rw-r--r-- | src/api/users.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/api/users.rs b/src/api/users.rs index 7c65eb5..1d01af7 100644 --- a/src/api/users.rs +++ b/src/api/users.rs @@ -1,7 +1,7 @@ //! `/admin/users`: the swarm's users and what each may do (`access.md`), managed //! through the API rather than by writing the registry's entries through the store. //! -//! * `GET /admin/users`: every user, its entry and whether it may manage users. +//! * `GET /admin/users`: every user and its entry. //! * `GET /admin/users/{name}`: one. //! * `POST /admin/users/{name}`: adds a user, with the capabilities of the body //! (`{"caps": [{"path": [...], "rights": ["read", "write"]}, …]}`, none if absent); @@ -119,13 +119,11 @@ fn may_manage(state: &AppState, user: &str, access: &Access) -> Result<(), ApiEr } } -/// A user's entry as the API shows it: as recorded, and whether it may manage users. +/// A user's entry as the API shows it: as recorded, with its name. fn shown(doc: &impl crate::document::ReadDoc, name: &str) -> Option<JsonValue> { let mut entry = store::read_path(doc, ®istry::user_path(name)).ok()??; - let manages = registry::caps_of(doc, name).allows(Right::Write, ®istry::users_dir()); if let Some(object) = entry.as_object_mut() { object.insert("name".to_owned(), json!(name)); - object.insert("manages".to_owned(), json!(manages)); } Some(entry) } |
