Align RBAC API contract
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
8dc61d7786
commit
4c4d037a1e
39 files changed
+410
-1071
No files matched your search
@@ -71,6 +71,14 @@ src/
|
||||
└── pages/ # Router tarafından çağrılan ana sayfalar
|
||||
```
|
||||
|
||||
## 5. Authorization (RBAC) Contract
|
||||
|
||||
- Permissions use one code per module (`users`, `roles`, `branches`, `provinces`, `activity-logs`, `backups`, `currencies`, `payment-settings`, `cards`, `loans`, and `dashboard`); a granted code allows both reading and writing that module.
|
||||
- `GET /profile` supplies `role.scope` (`own`, `branch`, or `all`), `role.isSuper`, and `permissions: [{ code, name }]`. Do not depend on `guardName` or a `modules` field.
|
||||
- `GET /permissions` is a read-only `{ code, name }[]` catalog. Permission create, update, delete, tree, and detail endpoints are not supported.
|
||||
- Role creation sends `{ code, name, scope, permissions: string[] }`; role updates send `{ name, scope, permissions: string[] }`. Role codes are immutable. A role with `isSystem: true` cannot be deleted or have its scope changed.
|
||||
- User role assignment uses `PUT /users/:id/role` with `{ roleId }`. Create/update user payloads may include both `role` (code) and `roleId`; the backend prioritizes `roleId`.
|
||||
|
||||
## AI / Agent İçin Katı Talimatlar (System Instructions)
|
||||
|
||||
1. Yeni bir bileşen veya özellik ekleneceğinde her zaman önce `src/features/` altına eklenip eklenmeyeceğini değerlendir.
|
||||
|
||||
Reference in new issue
Block a user