Changeset 0.37.1 (#213)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-20 22:15:57 +00:00
committed by xcaliber
parent 0ab2800c7e
commit 8c53f61b71
8 changed files with 1803 additions and 24 deletions

View File

@@ -203,3 +203,48 @@ array values are all normalized to `{}` before merge.
Returns the updated settings (same shape as `GET /settings`).
---
### Get My Permissions
```
GET /profile/permissions
```
**Auth:** Authenticated user
Returns the current user's resolved permission set, contributing group
IDs, team memberships, and UI-relevant policies. Admin users receive all
permissions by definition.
**Response:**
```json
{
"permissions": ["model.use", "kb.read", "channel.create"],
"groups": ["group-id-1", "00000000-0000-0000-0000-000000000001"],
"teams": [
{ "id": "uuid", "name": "Engineering", "my_role": "member" }
],
"policies": {
"allow_user_byok": false,
"allow_user_personas": false,
"allow_raw_model_access": true,
"kb_direct_access": true
}
}
```
| Field | Type | Description |
|-------|------|-------------|
| `permissions` | string[] | Resolved permission set (union of all group permissions) |
| `groups` | string[] | Contributing group IDs (always includes Everyone) |
| `teams` | object[] | User's active team memberships with `my_role` |
| `policies` | object | Boolean policy flags relevant to UI feature gating |
`permissions` is sorted alphabetically. `teams` includes only active teams
the user is a member of.
This endpoint is the SDK's bootstrap source for `sw.can(permission)`.
Called once at login and on each token refresh.
---