mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-22 14:05:19 +02:00
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:
4 files changed
+248
No files matched your search
@@ -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]
|
||||
Reference in new issue
Block a user