Milestone M3: roles, permissions and organization policies. Builds on #46.
Model
Permissions such as monitors.write or members.manage; write/manage implies read.
Built-in roles Admin, Editor, Viewer (seeded, read-only) plus custom roles per org. The owner holds everything implicitly.
Assignments are org-wide or scoped to one monitor group or status page. The scoped resources arrive in M4/M7; the model and checks are in place.
Nobody can grant, revoke, remove or invite with more than they hold. Editing a custom role requires holding both its old and new permissions.
Access
Every /api/v1/org/* route resolves a principal from the session or a Bearer ust_… token and checks a permission.
API tokens are personal, capped by the owner's current rights (shrinking roles shrinks tokens; leaving the org revokes them) and cannot manage credentials, members or roles.
Invitations: link-based, 7 days, single use, bound to the invited email. The inviter must still be allowed to grant the role when the invitation is accepted. Invitees can create an account regardless of UPTIME_SIGNUP.
SSO auto-provisioning assigns a configurable default role (Viewer if unset).
Organization policies
Require TOTP: password sessions need TOTP; SSO sessions rely on the IdP's MFA.
Require SSO: members must sign in through the org's IdP; the owner keeps a password fallback.
A policy cannot be switched on by someone whose own session would violate it.
UI
Members, Roles, API tokens and Organization settings pages; navigation follows permissions; a banner explains unmet policies.
Testing
internal/api/permissions_test.go covers delegation without escalation, tokens following their owner, policies, invitations and org isolation.
Milestone M3: roles, permissions and organization policies. Builds on #46.
## Model
- Permissions such as `monitors.write` or `members.manage`; write/manage implies read.
- Built-in roles Admin, Editor, Viewer (seeded, read-only) plus custom roles per org. The owner holds everything implicitly.
- Assignments are org-wide or scoped to one monitor group or status page. The scoped resources arrive in M4/M7; the model and checks are in place.
- Nobody can grant, revoke, remove or invite with more than they hold. Editing a custom role requires holding both its old and new permissions.
## Access
- Every `/api/v1/org/*` route resolves a principal from the session or a `Bearer ust_…` token and checks a permission.
- API tokens are personal, capped by the owner's *current* rights (shrinking roles shrinks tokens; leaving the org revokes them) and cannot manage credentials, members or roles.
- Invitations: link-based, 7 days, single use, bound to the invited email. The inviter must still be allowed to grant the role when the invitation is accepted. Invitees can create an account regardless of `UPTIME_SIGNUP`.
- SSO auto-provisioning assigns a configurable default role (Viewer if unset).
## Organization policies
- Require TOTP: password sessions need TOTP; SSO sessions rely on the IdP's MFA.
- Require SSO: members must sign in through the org's IdP; the owner keeps a password fallback.
- A policy cannot be switched on by someone whose own session would violate it.
## UI
Members, Roles, API tokens and Organization settings pages; navigation follows permissions; a banner explains unmet policies.
## Testing
`internal/api/permissions_test.go` covers delegation without escalation, tokens following their owner, policies, invitations and org isolation.
Closes #6, #7, #8, #9, #41, #45
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi
added this to the M3 Permissions milestone 2026-11-21 23:50:19 +00:00
Every org route resolves a principal from the session or a bearer token
and checks a permission. Nobody can grant, revoke or remove more than
they hold. Tokens are capped by their owner's current rights and cannot
manage credentials. Orgs can require TOTP or SSO; the owner keeps a
password fallback for SSO.
Closes#6Closes#7Closes#8Closes#9Closes#41Closes#45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Holders of tokens.manage list every token of the org with owner,
permissions, creation, expiry and last use, and can revoke any of them.
A maximum lifetime rejects tokens that would outlive it and shortens
existing ones when it is set.
Closes#48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Milestone M3: roles, permissions and organization policies. Builds on #46.
Model
monitors.writeormembers.manage; write/manage implies read.Access
/api/v1/org/*route resolves a principal from the session or aBearer ust_…token and checks a permission.UPTIME_SIGNUP.Organization policies
UI
Members, Roles, API tokens and Organization settings pages; navigation follows permissions; a banner explains unmet policies.
Testing
internal/api/permissions_test.gocovers delegation without escalation, tokens following their owner, policies, invitations and org isolation.Closes #6, #7, #8, #9, #41, #45
🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3