diff --git a/gns3server/api/routes/controller/roles.py b/gns3server/api/routes/controller/roles.py index a3aceca3..f1a5434f 100644 --- a/gns3server/api/routes/controller/roles.py +++ b/gns3server/api/routes/controller/roles.py @@ -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, diff --git a/tests/api/routes/controller/test_roles.py b/tests/api/routes/controller/test_roles.py index ec0f614d..b6fca22b 100644 --- a/tests/api/routes/controller/test_roles.py +++ b/tests/api/routes/controller/test_roles.py @@ -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"))