Remove privileges endpoint from roles

This commit is contained in:
grossmj 2023-09-14 22:41:08 +07:00
parent 63c1defd9a
commit 7534718a1c
2 changed files with 0 additions and 23 deletions

View File

@ -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,

View File

@ -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"))