Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add new url for role master api keys #3215

Merged
merged 9 commits into from
Dec 22, 2023
15 changes: 14 additions & 1 deletion api/organisations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,27 @@
RoleOrganisationPermissionViewSet,
RoleProjectPermissionsViewSet,
RolesByGroupViewSet,
RolesbyMasterAPIPrefixViewSet,
RolesByUserViewSet,
RoleViewSet,
UserRoleViewSet,
)

organisations_router.register("roles", RoleViewSet, basename="organisation-roles")
nested_user_roles_routes = routers.NestedSimpleRouter(
parent_router=organisations_router, parent_prefix=r"users", lookup="user"
)

nested_api_key_roles_routes = routers.NestedSimpleRouter(
parent_router=organisations_router,
parent_prefix=r"master-api-keys",
lookup="api_key",
)

nested_group_roles_routes = routers.NestedSimpleRouter(
parent_router=organisations_router, parent_prefix=r"groups", lookup="group"
)

organisations_router.register("roles", RoleViewSet, basename="organisation-roles")
nested_roles_router = routers.NestedSimpleRouter(
organisations_router, r"roles", lookup="role"
)
Expand All @@ -125,6 +132,11 @@
viewset=RolesByUserViewSet,
basename="role-users",
)
nested_api_key_roles_routes.register(
prefix="roles",
viewset=RolesbyMasterAPIPrefixViewSet,
basename="role-api-keys",
)
nested_group_roles_routes.register(
prefix="roles",
viewset=RolesByGroupViewSet,
Expand Down Expand Up @@ -155,6 +167,7 @@
url(r"^", include(organisations_router.urls)),
url(r"^", include(nested_roles_router.urls)),
url(r"^", include(nested_user_roles_routes.urls)),
url(r"^", include(nested_api_key_roles_routes.urls)),
url(r"^", include(nested_group_roles_routes.urls)),
]
)