mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Remove privileges endpoint from roles
This commit is contained in:
parent
63c1defd9a
commit
7534718a1c
@ -81,23 +81,6 @@ async def create_role(
|
||||
return await rbac_repo.create_role(role_create)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/privileges",
|
||||
response_model=List[schemas.Privilege],
|
||||
dependencies=[Depends(has_privilege("Role.Audit"))]
|
||||
)
|
||||
async def get_privileges(
|
||||
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
|
||||
) -> List[schemas.Privilege]:
|
||||
"""
|
||||
Get all available privileges.
|
||||
|
||||
Required privilege: Role.Audit
|
||||
"""
|
||||
|
||||
return await rbac_repo.get_privileges()
|
||||
|
||||
|
||||
@router.get(
|
||||
"/{role_id}",
|
||||
response_model=schemas.Role,
|
||||
|
@ -42,12 +42,6 @@ class TestRolesRoutes:
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json()["role_id"] == str(role_in_db.role_id)
|
||||
|
||||
async def test_get_privileges(self, app: FastAPI, client: AsyncClient):
|
||||
|
||||
response = await client.get(app.url_path_for("get_privileges"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert len(response.json()) == 45 # 45 built-in privileges
|
||||
|
||||
async def test_list_roles(self, app: FastAPI, client: AsyncClient) -> None:
|
||||
|
||||
response = await client.get(app.url_path_for("get_roles"))
|
||||
|
Loading…
Reference in New Issue
Block a user