feat: add endpoint for the current user's privileges on a project

GET /projects/{project_id}/me/privileges returns the effective privileges
of the logged in user, evaluated on the project's resource path. Unlike
/access/users/me/privileges, ACEs scoped to the project and resource
pools containing it are reflected. This gives clients what they need to
show or hide buttons inside a project view.
This commit is contained in:
YueGuobin committed 2026-11-07 00:27:32 +08:00
1 parent 111a4b756c
commit f8eedae9fc
4 files changed
+248

No files matched your search

+15
View File
@@ -139,3 +139,18 @@ class ProjectStats(BaseModel):
drawings: int
snapshots: int
markers: int
class ProjectPrivileges(BaseModel):
"""
Effective privileges of the logged in user on a single project, evaluated
on the project's resource path (so ACEs scoped to that project and
resource pools containing it are reflected).
This is a hint for rendering purposes only (e.g. showing or hiding buttons
in the project view): the server remains the authority for permission
checks on each request.
"""
is_superadmin: bool
privileges: List[str]