1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Put user, groups, roles and ACL under /access

This commit is contained in:
grossmj 2023-09-02 19:10:02 +07:00
parent a358369606
commit 6ec97a704f
4 changed files with 10 additions and 10 deletions

View File

@ -44,25 +44,25 @@ router.include_router(
router.include_router(
users.router,
prefix="/users",
prefix="/access/users",
tags=["Users"]
)
router.include_router(
groups.router,
prefix="/groups",
prefix="/access/groups",
tags=["Users groups"]
)
router.include_router(
roles.router,
prefix="/roles",
prefix="/access/roles",
tags=["Roles"]
)
router.include_router(
acl.router,
prefix="/acl",
prefix="/access/acl",
tags=["ACL"]
)

View File

@ -99,19 +99,19 @@ async def endpoints(
)
# users
add_to_endpoints("/users", "All users", "user")
add_to_endpoints("/access/users", "All users", "user")
users = await users_repo.get_users()
for user in users:
add_to_endpoints(f"/users/{user.user_id}", f'User "{user.username}"', "user")
# groups
add_to_endpoints("/groups", "All groups", "group")
add_to_endpoints("/access/groups", "All groups", "group")
groups = await users_repo.get_user_groups()
for group in groups:
add_to_endpoints(f"/groups/{group.user_group_id}", f'Group "{group.name}"', "group")
# roles
add_to_endpoints("/roles", "All roles", "role")
add_to_endpoints("/access/roles", "All roles", "role")
roles = await rbac_repo.get_roles()
for role in roles:
add_to_endpoints(f"/roles/{role.role_id}", f'Role "{role.name}"', "role")

View File

@ -62,7 +62,7 @@ class TestACLRoutes:
rbac_repo = RbacRepository(db_session)
admin_role_id = (await rbac_repo.get_role_by_name("Administrator")).role_id
ace = ACECreate(
path="/acl",
path="/access/acl",
ace_type="user",
user_id=test_user.user_id,
role_id=admin_role_id

View File

@ -29,8 +29,8 @@ ALLOWED_CONTROLLER_ENDPOINTS = [
("/static/web-ui/{file_path:path}", "GET"),
("/v3/version", "GET"),
("/v3/version", "POST"),
("/v3/users/login", "POST"),
("/v3/users/authenticate", "POST"),
("/v3/access/users/login", "POST"),
("/v3/access/users/authenticate", "POST"),
("/v3/symbols", "GET"),
("/v3/symbols/{symbol_id:path}/raw", "GET"),
("/v3/symbols/{symbol_id:path}/dimensions", "GET"),