mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-04 01:31:33 +03:00
fix(acl): correct endpoint paths for users, groups, and roles
Fix the path mismatch between /acl/endpoints API and actual routes:
- Users: /users/{id} → /access/users/{id}
- Groups: /groups/{id} → /access/groups/{id}
- Roles: /roles/{id} → /access/roles/{id}
This fixes the error where creating ACE entries fails with:
"Path '/groups/{id}' doesn't match any existing endpoint"
The actual routes are registered under /access/ prefix, but the
endpoints API was returning paths without the prefix.
Co-Authored-By: Yue Guobin <yueguobin@outlook.com>
This commit is contained in:
parent
dce4a71004
commit
f2fd725e07
@ -115,19 +115,19 @@ async def endpoints(
|
|||||||
add_to_endpoints("/access/users", "All users", "user")
|
add_to_endpoints("/access/users", "All users", "user")
|
||||||
users = await users_repo.get_users()
|
users = await users_repo.get_users()
|
||||||
for user in users:
|
for user in users:
|
||||||
add_to_endpoints(f"/users/{user.user_id}", f'User "{user.username}"', "user")
|
add_to_endpoints(f"/access/users/{user.user_id}", f'User "{user.username}"', "user")
|
||||||
|
|
||||||
# groups
|
# groups
|
||||||
add_to_endpoints("/access/groups", "All groups", "group")
|
add_to_endpoints("/access/groups", "All groups", "group")
|
||||||
groups = await users_repo.get_user_groups()
|
groups = await users_repo.get_user_groups()
|
||||||
for group in groups:
|
for group in groups:
|
||||||
add_to_endpoints(f"/groups/{group.user_group_id}", f'Group "{group.name}"', "group")
|
add_to_endpoints(f"/access/groups/{group.user_group_id}", f'Group "{group.name}"', "group")
|
||||||
|
|
||||||
# roles
|
# roles
|
||||||
add_to_endpoints("/access/roles", "All roles", "role")
|
add_to_endpoints("/access/roles", "All roles", "role")
|
||||||
roles = await rbac_repo.get_roles()
|
roles = await rbac_repo.get_roles()
|
||||||
for role in roles:
|
for role in roles:
|
||||||
add_to_endpoints(f"/roles/{role.role_id}", f'Role "{role.name}"', "role")
|
add_to_endpoints(f"/access/roles/{role.role_id}", f'Role "{role.name}"', "role")
|
||||||
|
|
||||||
# images
|
# images
|
||||||
add_to_endpoints("/images", "All images", "image")
|
add_to_endpoints("/images", "All images", "image")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user