docs: ownership rules and settings access for owners/managers
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfPpSpccTWBfZg1FTveyaU
This commit is contained in:
+15
-13
@@ -32,15 +32,16 @@ base_url: https://hbd.example.com
|
|||||||
|
|
||||||
### Channel definitions
|
### Channel definitions
|
||||||
|
|
||||||
Channels are defined under `notification_channels`. Each entry specifies a delivery type and its credentials. Two optional metadata fields control visibility:
|
Channels are defined under `notification_channels`. Each entry specifies a delivery type and its credentials. Ownership is the single visibility signal:
|
||||||
|
|
||||||
| Field | Default | Description |
|
| Field | Default | Description |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `owner` | *(absent)* | Username who created/owns this channel. Absent = admin-created. |
|
| `owner` | *(absent)* | Owning username. Present = private to that user; absent = global. |
|
||||||
| `private` | `false` | When `true`, only the owner can see and select this channel. |
|
|
||||||
| `min_level` | `WARNING` | Minimum alert level this channel receives. |
|
| `min_level` | `WARNING` | Minimum alert level this channel receives. |
|
||||||
|
|
||||||
**Admin-created channels** (set in the config file or via the admin settings UI) are public by default — all users can select them:
|
(The former `private` flag is retired; leftover `private` keys are ignored and dropped on the next edit.)
|
||||||
|
|
||||||
|
**Global channels** (no `owner`; set in the config file or by an admin) can be selected by all users but edited only by admins:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notification_channels:
|
notification_channels:
|
||||||
@@ -90,7 +91,7 @@ notification_channels:
|
|||||||
username: heartbeat-bot
|
username: heartbeat-bot
|
||||||
```
|
```
|
||||||
|
|
||||||
**User-created channels** are written by authenticated users through the API or their profile page. They carry an `owner` field and optionally `private: true`:
|
**User-created channels** are written by authenticated users through the API, their profile page, or the settings page. They carry an `owner` field and are private to that user:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notification_channels:
|
notification_channels:
|
||||||
@@ -99,17 +100,18 @@ notification_channels:
|
|||||||
type: pushover
|
type: pushover
|
||||||
token: personal-token
|
token: personal-token
|
||||||
user: personal-key
|
user: personal-key
|
||||||
owner: alice # created by alice
|
owner: alice # private to alice
|
||||||
private: true # only alice can see this channel
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Channel visibility
|
### Channel visibility
|
||||||
|
|
||||||
| Channel | Who can see / select it |
|
| Channel | Who can see / select it | Who can edit it |
|
||||||
|---|---|
|
|---|---|---|
|
||||||
| No `private` field (or `private: false`) | All users |
|
| No `owner` (global) | All users | Admins |
|
||||||
| `private: true` | Only the `owner` |
|
| `owner` set (private) | Only the `owner` | The owner |
|
||||||
| Any channel | Admins always see everything |
|
| Any channel | Admins always see everything | Admins |
|
||||||
|
|
||||||
|
Admins can **promote** a private channel to global by clearing its owner on the settings page, or **demote** a global channel by assigning an owner.
|
||||||
|
|
||||||
### Users with notification channels
|
### Users with notification channels
|
||||||
|
|
||||||
@@ -299,7 +301,7 @@ Called once at startup from `main.py`. Pass the running asyncio event loop so Ma
|
|||||||
- Check that the host has an `owner` or `managers` set
|
- Check that the host has an `owner` or `managers` set
|
||||||
- Check that users have `notification_channels` listed
|
- Check that users have `notification_channels` listed
|
||||||
- Check that the channel names in user config match keys under `notification_channels:`
|
- Check that the channel names in user config match keys under `notification_channels:`
|
||||||
- If a user can't select a channel, check whether it is `private: true` and owned by someone else
|
- If a user can't select a channel, check whether it has an `owner` other than that user
|
||||||
|
|
||||||
**min_level filtering too aggressive:**
|
**min_level filtering too aggressive:**
|
||||||
- Default is `WARNING` — both WARNING and CRITICAL are sent
|
- Default is `WARNING` — both WARNING and CRITICAL are sent
|
||||||
|
|||||||
+10
-1
@@ -19,6 +19,15 @@ Users are defined in the server config file. Each host can have an **owner**, ze
|
|||||||
|
|
||||||
`admin` is a flag on the user, not a per-host role. An admin user has owner-level access on every host without being listed as owner/manager/monitor.
|
`admin` is a flag on the user, not a per-host role. An admin user has owner-level access on every host without being listed as owner/manager/monitor.
|
||||||
|
|
||||||
|
### Settings page access
|
||||||
|
|
||||||
|
All authenticated users may open `/settings`. Admins see every section; non-admins see only **Notification Channels**, **Hosts**, and **Threshold Configurations**, filtered to global items plus what they own or manage:
|
||||||
|
|
||||||
|
- **Owners** may add hosts, delete their hosts, edit host settings, and change access lists (managers/monitors, ownership transfer).
|
||||||
|
- **Managers** may edit host settings (watch, dyndns, channel and threshold assignments) but not access lists, and may not delete hosts.
|
||||||
|
- Anyone may create private notification channels and threshold configs (owned by them) and assign them — or global ones — to their hosts.
|
||||||
|
- Admins promote a private channel/threshold config to global by clearing its owner, or demote by assigning one.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@@ -200,7 +209,7 @@ Update the current user's profile. All fields are optional — send only what yo
|
|||||||
```json
|
```json
|
||||||
{ "notification_channels": ["pushover_ops", "email_ops"] }
|
{ "notification_channels": ["pushover_ops", "email_ops"] }
|
||||||
```
|
```
|
||||||
Only channels visible to the user (public + own private) are accepted; others are silently dropped.
|
Only channels visible to the user (global + own) are accepted; others are silently dropped.
|
||||||
|
|
||||||
**Change password:**
|
**Change password:**
|
||||||
```json
|
```json
|
||||||
|
|||||||
Reference in New Issue
Block a user