Add groups, invitations and instruments #3
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/groups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Notenwart serves several groups from one installation, so tenant separation has to be the foundation for every feature that follows, not something added afterwards. This PR puts all access decisions into one place and adds a test that covers every future route automatically.
What
access.pyas the only place that decides access. Non-members get 404, so a group's existence stays hiddenTests
tests/test_tenant_isolation.pysweeps all routes of the app: outsiders get 404, ids of a foreign group under the own slug get 404, roles below the minimum get 403, anonymous visitors go to login. Routes outside/g/{slug}must be listed explicitly, and an unknown path parameter fails the test.Verification
make lintandpytestpass (146 tests)The first sweep version found zero routes and skipped silently, because FastAPI 0.162 includes routers lazily.
test_routes_were_foundcaught that; routes now come fromALL_ROUTERS.