mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 01:50:24 -05:00
more user admin actions
This commit is contained in:
@@ -24,8 +24,10 @@ Status: **current**.
|
||||
* [Request 3](#request-3)
|
||||
* [User management](#user-management)
|
||||
* [`GET /api/users`](#get-apiusers)
|
||||
* [`PUT /api/users`](#put-apiusers)
|
||||
* [`GET /api/users/<id>`](#get-apiusersid)
|
||||
* [`POST /api/users/<id>`](#post-apiusersid)
|
||||
* [`DELETE /api/users/<id>`](#delete-apiusersid)
|
||||
|
||||
## Objective
|
||||
|
||||
@@ -834,6 +836,19 @@ Requires the `admin_users` permission.
|
||||
Lists all users. Currently there's no paging. Returns a JSON object with
|
||||
a `users` key with a map of id to username.
|
||||
|
||||
#### `PUT /api/users`
|
||||
|
||||
Requires the `admin_users` permission.
|
||||
|
||||
Adds a user. Expects a JSON dictionary with the parameters for the user:
|
||||
|
||||
* `username`: a string, which must be unique.
|
||||
* `permissions`: a JSON dictionary of permissions.
|
||||
* `password` (optional): a string.
|
||||
* `preferences` (optional): a JSON dictionary.
|
||||
|
||||
Returns status 204 (No Content) on success.
|
||||
|
||||
#### `GET /api/users/<id>`
|
||||
|
||||
Retrieves the user. Requires the `admin_users` permission if the caller is
|
||||
@@ -869,6 +884,12 @@ Currently the following fields are supported for `update` and `precondition`:
|
||||
|
||||
Returns HTTP status 204 (No Content) on success.
|
||||
|
||||
#### `DELETE /api/users/<id>`
|
||||
|
||||
Deletes the given user. Requires the `admin_users` permission.
|
||||
|
||||
Returns HTTP status 204 (No Content) on success.
|
||||
|
||||
[media-segment]: https://w3c.github.io/media-source/isobmff-byte-stream-format.html#iso-media-segments
|
||||
[init-segment]: https://w3c.github.io/media-source/isobmff-byte-stream-format.html#iso-init-segments
|
||||
[rfc-6381]: https://tools.ietf.org/html/rfc6381
|
||||
|
||||
Reference in New Issue
Block a user