Repository navigation
fix(track-chairs): let summit admins manage team selection lists - #678
Conversation
The auth.user authz groups for the team selection list endpoints (GET/POST
selection-lists/team and PUT selection-lists/{list_id}/reorder) did not
include summit administrators, so summit-admin's Team Lists page returned
403 for them even though Summit::isTrackChair already allows a summit
admin of that summit.
Add SummitAdministrators to those endpoints in ApiEndpointsSeeder, the
OpenAPI authz_groups, and a config migration for deployed environments.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-678/ This page is automatically updated on each push to this PR. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the summit-administrator team-list access change.
No open issues 🎉
What changed in this PR
Enables summit administrators to use summit-admin’s Track Chairs > Team Lists page by admitting them through endpoint authorization while preserving existing summit-specific permission checks.
Changes:
- Adds the summit-administrator group to team-list GET, POST, and selection-list reorder authorization through a reversible migration and fresh-install seed data.
- Updates OpenAPI authorization metadata for the three operations.
- Adds API tests covering authorized create/get/reorder requests and denied GET access without the summit’s permission group.
| File | Description |
|---|---|
| tests/oauth2/OAuth2SummitSelectedPresentationListSummitAdminApiTest.php | Adds summit-admin access and summit-scoping regression tests. |
| database/seeders/ApiEndpointsSeeder.php | Grants the endpoint group access on fresh installs. |
| database/migrations/config/Version20261117120000.php | Adds an idempotent authorization migration with rollback support. |
| app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php | Documents summit-admin access in OpenAPI metadata. |
Review effort: Balanced
ref: https://app.clickup.com/t/1k5eh578fhf
Summit admins can now use summit-admin's Track Chairs > Team Lists page. Before this change it returned "user not authorized" for them.
Problem
The page calls three endpoints:
GET /api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/teamPOST /api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/teamPUT /api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/{list_id}/reorderTheir
auth.userauthz groups weresuper-admins,administrators,track-chairsandtrack-chairs-admins.UserAuthEndpointreturned 403 to a summit admin (summit-front-end-administrators) before the controller ran. The service check behind them,Summit::isTrackChair(), already accepts a summit admin of that summit (isSummitAdmin(): the summit admins group plus the summit's permission group), so the middleware was the only thing blocking them.Changes
database/migrations/config/Version20261117120000.php: addssummit-front-end-administratorstoget-team-selection-list,add-team-selection-listandreorder-selection-list. It is idempotent, anddown()removes the group again.ApiEndpointsSeeder: the same three endpoints get the group, for fresh installs.OAuth2SummitSelectedPresentationListApiController: the OpenAPIauthz_groupsof the three operations now list the group.Per-summit scoping does not change. A summit admin who is not in the summit's permission group still gets a 403 from the service.
The individual selection-list endpoints are not changed. Team Lists does not use them.
Deployment
Run the config migrations.
Flush the cache after deploy.
UserAuthEndpointcaches the groups for each route and method, and the allow/deny result for each member, with no TTL. Until the cache is flushed, summit admins who already got a 403 keep getting it.Delete only the
UserAuthEndpointkeys, from any one pod (all pods share the same Redis):laravelwith no separator, so the keys arelaraveluser_auth_endpoint_<route>_<method>(the endpoint's groups) andlaraveluser_auth_endpoint_<route>_<method>_<member_id>(each member's result). The pattern deletes both.SCANwalks the keys in batches.KEYSwould block Valkey while it scans the whole DB.Redis::alias resolves to the phpredis extension class and fails withCall to undefined method Redis::connection().php artisan cache:clear. Thecachestore uses Redis DB 0, which thedefaultconnection also uses, andcache:clearrunsFLUSHDBon it. That also drops cached access tokens, cached API responses, locks and rate limits.Tests
New
tests/oauth2/OAuth2SummitSelectedPresentationListSummitAdminApiTest.php, run by theOAuth2Testsjob. The identity is in the summit admins group and is not a global admin or a track chair. The token stub carries no admin IdP groups.testSummitAdminCanCreateGetAndReorderTeamSelectionList: a summit admin of the summit creates the team list (201), gets it (200) and reorders it (201). Onmainthe create returns 403.testSummitAdminOfAnotherSummitCannotGetTeamSelectionList: without the summit's permission group, the GET still returns 403.tests/oauth2/OAuth2SummitSelectedPresentationListApiTest.phpandtests/SummitSelectedPresentationListServiceTest.phpstill pass. The migration was also run down and up against the local config DB: 3 → 0 → 3 rows, and a secondupleaves 3.