Skip to content

Commit 6eb95db

Browse files
committed
docs(server): update users endpoint permissions and project delete role matrix
1 parent a13792d commit 6eb95db

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ flowchart LR
3030
- JWT validation in API service.
3131
- Role and resource-based authorization checks in handlers.
3232
- Auth user directory exposes `isActive` status and user roles.
33-
- Admin-only user management endpoints in Auth service:
33+
- User management endpoints in Auth service:
3434
- `GET /api/users` with `search`, `isActive`, and `role` filters (paged).
35+
- `Administrator`: can query all users with full filters.
36+
- `ProjectManager`: restricted to `role=User` queries (assignable-contributor lookup).
3537
- `GET /api/users/{id}/details` for richer admin user profile data.
3638
- `PATCH /api/users/{id}/status` to activate/deactivate users.
3739
- Safety guards:

docs/API_CONTRACT.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This guide centralizes SPA-facing API behavior across both services:
44
- `TaskManagement.Api`
5-
- `TaskManagement.Auth` (admin user-management APIs under `api/*`)
5+
- `TaskManagement.Auth` (user-management APIs under `api/*`)
66

77
Use this as the single contract reference for filters, pagination, patch semantics, and error format.
88

@@ -12,7 +12,7 @@ List endpoints support pagination:
1212
- `GET /api/projects`
1313
- `GET /api/taskitems`
1414
- `GET /api/activity`
15-
- `GET /api/users` (Auth service, admin-only)
15+
- `GET /api/users` (Auth service, role-restricted behavior)
1616

1717
Defaults and caps:
1818
- Projects: `page=1`, `pageSize=50`, max `200`
@@ -53,6 +53,10 @@ Supported query params:
5353
- `role`
5454
- `page`, `pageSize`, `skip`, `take`
5555

56+
Authorization behavior:
57+
- `Administrator`: full user listing/filtering.
58+
- `ProjectManager`: allowed only when `role=User`; other queries return `403`.
59+
5660
## Patch Semantics
5761

5862
Patch endpoints:
@@ -99,6 +103,11 @@ Endpoints:
99103
- `GET /api/users/{id}/details`
100104
- `PATCH /api/users/{id}/status`
101105

106+
Endpoint access:
107+
- `GET /api/users`: `Administrator` + `ProjectManager` (PM restricted to `role=User`).
108+
- `GET /api/users/{id}/details`: `Administrator` only.
109+
- `PATCH /api/users/{id}/status`: `Administrator` only.
110+
102111
Status change payload:
103112

104113
```json

docs/ROLE_MATRIX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Legend:
1414
| `POST /api/projects` (create) | Yes | Yes | No | Policy `CanManageProjects` |
1515
| `PUT /api/projects/{id}` (update) | Yes | Yes | No | PM/Admin not restricted by owner |
1616
| `PATCH /api/projects/{id}` (partial update) | Yes | Yes | No | PM/Admin not restricted by owner |
17-
| `DELETE /api/projects/{id}` (delete) | Yes | Yes | No | PM/Admin not restricted by owner |
17+
| `DELETE /api/projects/{id}` (delete) | Yes | Scoped | No | PM must be project owner |
1818
| `GET /api/projects/{id}` (read one) | Yes | Yes | Scoped | User must be owner/member |
1919
| `GET /api/projects` (read list) | Yes (all) | Scoped | Scoped | Non-admin: owner/member projects |
2020
| `GET /api/projects/my-projects` | Scoped | Scoped | Scoped | Owner/member projects |

0 commit comments

Comments
 (0)