Skip to content

Commit

Permalink
feat: Add new url for role users (#3120)
Browse files Browse the repository at this point in the history
  • Loading branch information
novakzaballa authored Dec 8, 2023
1 parent f8d05ed commit 0604ec1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/organisations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,24 @@
RoleEnvironmentPermissionsViewSet,
RoleOrganisationPermissionViewSet,
RoleProjectPermissionsViewSet,
RolesByUserViewSet,
RoleViewSet,
UserRoleViewSet,
)

nested_user_roles_routes = routers.NestedSimpleRouter(
parent_router=organisations_router, parent_prefix=r"users", lookup="user"
)

organisations_router.register("roles", RoleViewSet, basename="organisation-roles")
nested_roles_router = routers.NestedSimpleRouter(
organisations_router, r"roles", lookup="role"
)
nested_user_roles_routes.register(
prefix="roles",
viewset=RolesByUserViewSet,
basename="role-users",
)
nested_roles_router.register(
"environments-permissions",
RoleEnvironmentPermissionsViewSet,
Expand All @@ -134,5 +144,6 @@
[
url(r"^", include(organisations_router.urls)),
url(r"^", include(nested_roles_router.urls)),
url(r"^", include(nested_user_roles_routes.urls)),
]
)

0 comments on commit 0604ec1

Please sign in to comment.