shinkan-jinkendo/backend/tests/test_admin_rights.py
Lars e4cb491d46
Some checks failed
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Failing after 1s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Has been cancelled
Refactor Admin Rights Management and Update Versioning
- Replaced the admin club feature exemptions router with a new admin rights router to streamline capability management.
- Added new API endpoints for managing admin rights, including capability grants and quota bypass for portal roles and profiles.
- Updated the frontend to include navigation and lazy loading for the new Admin Rights page.
- Incremented application version to 0.8.197 to reflect these changes and enhancements.
2026-06-07 09:21:59 +02:00

22 lines
650 B
Python

"""M6: Admin-Rollen/Rechte-API — Zugriffskontrolle."""
import pytest
from fastapi import HTTPException
from routers.admin_rights import get_capability_matrix, _require_superadmin
def test_require_superadmin_denies_admin():
with pytest.raises(HTTPException) as exc:
_require_superadmin({"role": "admin"})
assert exc.value.status_code == 403
def test_require_superadmin_allows():
_require_superadmin({"role": "superadmin"})
def test_get_capability_matrix_requires_superadmin():
with pytest.raises(HTTPException) as exc:
get_capability_matrix(session={"role": "trainer"})
assert exc.value.status_code == 403