Repository navigation
feat(permissions): accept the stream group in admin access groups - #682
Conversation
Adds the IDP group stream to IGroup and to SummitAdministratorPermissionGroup::ValidGroups, so a member whose only group is stream can be added to a summit's Admin Access Group. GET /api/v1/summits/all then returns that summit for them: it is narrowed by the member's Admin Access Groups and needs no change.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-682/ This page is automatically updated on each push to this PR. |
An administrator adds a member whose only group is stream to a permission group through POST /api/v1/summit-administrator-groups, and that member's GET /api/v1/summits/all returns only the summit of their group, or 403 when they are on none. It lives under tests/oauth2 so the OAuth2Tests job runs it.
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-682/ This page is automatically updated on each push to this PR. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change enabling stream-group members to join summit-scoped administrator permission groups.
No open issues 🎉
What changed in this PR
Allows members of the stream identity-provider group to join summit Admin Access Groups, enabling FNstream access within their assigned summit scope.
Changes:
- Defines
IGroup::Streamand accepts it in administrator permission groups. - Adds model tests for membership validation and summit-scoped access.
- Adds HTTP tests for administrator assignment, scoped summit listing, and denial without a permission group.
| File | Description |
|---|---|
| tests/SummitStreamPermissionGroupTest.php | Tests stream membership eligibility and summit-scoped permissions. |
| tests/oauth2/OAuth2SummitStreamGroupApiTest.php | Tests HTTP assignment, scoped listing, and access denial. |
| app/Models/Foundation/Main/SummitAdministratorPermissionGroup.php | Adds stream to the accepted member groups. |
| app/Models/Foundation/Main/IGroup.php | Defines the Stream group constant. |
Review effort: Balanced
…r a summit
addMemberTo, removeMemberFrom, addSummitTo and removeSummitFrom declared a SummitAdministratorPermissionGroup return type, but their transaction callback returned nothing. The change was committed and the call then failed with a TypeError, so the four endpoints under /api/v1/summit-administrator-groups/{group_id}/members/{member_id} and /summits/{summit_id} answered 500. They now return the updated group, and each has a test.
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-682/ This page is automatically updated on each push to this PR. |
ref: https://app.clickup.com/t/1k5eh579akm
A member of the IDP group
streamoperates FNstream only on the summits of their Admin Access Groups. summit-api did not accept that group there, so astreammember could not be added to a summit.Changes
IGroup::Stream = 'stream'.IGroup::Streamadded toSummitAdministratorPermissionGroup::ValidGroups, the listcanAddMemberchecks.GET /api/v1/summits/allneeds no change: it has no group restriction, and it is narrowed by the summits of the member's Admin Access Groups (Member::getAllAllowedSummitsIds). A group summit-api does not know yet is created when it arrives from the IDP (MemberService::synchronizeGroups), so there is no migration and no seeder.No streaming field and no streaming endpoint is added, and no other group's permissions change.
Also fixed: four Admin Access Group endpoints answered 500
PUTandDELETEon/api/v1/summit-administrator-groups/{group_id}/members/{member_id}and on/api/v1/summit-administrator-groups/{group_id}/summits/{summit_id}answered 500, although the change was saved.addMemberTo,removeMemberFrom,addSummitToandremoveSummitFromdeclare that they return the group, and their transaction callback returned nothing, so each call ended in aTypeError. They now return the updated group, ascreateandupdatedo.It is in this PR because it was found while testing how a
streammember is added to a group. The controller is their only caller.Tests
tests/oauth2/OAuth2SummitStreamGroupApiTest.php, at the HTTP level, run by theOAuth2Testsjob:streamto a permission group throughPOST /api/v1/summit-administrator-groups, and gets 201;GET /api/v1/summits/allreturns only the summit of their group, out of the two in the fixture;tests/oauth2/OAuth2SummitAdministratorPermissionGroupApiControllerTest.php, four tests added, one per fixed endpoint: add a member, remove a member, add a summit, remove a summit. Each expects 201 and the updated list in the response.tests/SummitStreamPermissionGroupTest.php, at the model level, which mirrorsSummitRoomAdministratorPermissionGroupTest:streamis a valid group;streamjoins a permission group and is allowed its summit only;How it was verified
On a clean database built with the steps of
push.yml:streamtest files pass (3 tests and 4 tests). WithIGroup::Streamtaken out ofValidGroups, both fail: thePOSTanswers 412 instead of 201, andaddMemberthrows;tests/SummitStreamPermissionGroupTest.phpis not in the test matrix ofpush.yml, like the test it mirrors, so CI does not run it. The endpoint tests are the ones CI runs.