Skip to content

feat(permissions): accept the stream group in admin access groups - #682

Merged
smarcet merged 3 commits into
mainfrom
feature/stream-group-admin-access-groups
Nov 25, 2026
Merged

smarcet merged 3 commits into
mainfrom
feature/stream-group-admin-access-groups

Conversation

@smarcet

@smarcet smarcet commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

ref: https://app.clickup.com/t/1k5eh579akm

A member of the IDP group stream operates FNstream only on the summits of their Admin Access Groups. summit-api did not accept that group there, so a stream member could not be added to a summit.

Changes

  • IGroup::Stream = 'stream'.
  • IGroup::Stream added to SummitAdministratorPermissionGroup::ValidGroups, the list canAddMember checks.

GET /api/v1/summits/all needs 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

PUT and DELETE on /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, addSummitTo and removeSummitFrom declare that they return the group, and their transaction callback returned nothing, so each call ended in a TypeError. They now return the updated group, as create and update do.

It is in this PR because it was found while testing how a stream member is added to a group. The controller is their only caller.

Tests

tests/oauth2/OAuth2SummitStreamGroupApiTest.php, at the HTTP level, run by the OAuth2Tests job:

  • an administrator adds a member whose only group is stream to a permission group through POST /api/v1/summit-administrator-groups, and gets 201;
  • that member's GET /api/v1/summits/all returns only the summit of their group, out of the two in the fixture;
  • on no permission group, the same call answers 403.

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 mirrors SummitRoomAdministratorPermissionGroupTest:

  • stream is a valid group;
  • a member whose only group is stream joins a permission group and is allowed its summit only;
  • a member scoped to another summit is not allowed the first;
  • a member with no valid group is still rejected.
php vendor/bin/phpunit tests/oauth2/OAuth2SummitStreamGroupApiTest.php
php vendor/bin/phpunit tests/oauth2/OAuth2SummitAdministratorPermissionGroupApiControllerTest.php
php vendor/bin/phpunit tests/SummitStreamPermissionGroupTest.php

How it was verified

On a clean database built with the steps of push.yml:

  • the two stream test files pass (3 tests and 4 tests). With IGroup::Stream taken out of ValidGroups, both fail: the POST answers 412 instead of 201, and addMember throws;
  • the four new controller tests fail without the fix, each with 500 instead of 201, and the eight tests of that class pass with it.

tests/SummitStreamPermissionGroupTest.php is not in the test matrix of push.yml, like the test it mirrors, so CI does not run it. The endpoint tests are the ones CI runs.

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.
@smarcet smarcet self-assigned this Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds IGroup::Stream as an accepted group for summit administrator permission groups. New tests cover Stream-only member validation, permission-group membership, summit scoping, and rejection of members without a valid group.

Changes: Stream Permission Group

Layer / File(s) Summary
Add Stream to accepted groups
app/Models/Foundation/Main/IGroup.php, app/Models/Foundation/Main/SummitAdministratorPermissionGroup.php
IGroup defines the Stream slug, and ValidGroups includes it.
Test Stream membership and summit scope
tests/SummitStreamPermissionGroupTest.php
Tests verify that a Stream-only member can join a summit-scoped permission group, is limited to the scoped summit, and that a member without a valid group is rejected.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: romanetar

Merge Risk: Minimal · up to 1f67a

This change lets a member whose only IDP group is stream join a summit's Admin Access Group. Other groups' permissions are unchanged, and no concrete merge-blocking risk was found. CI will be the first run of the new tests.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the stream group is now accepted in admin access groups, which matches the IGroup::Stream constant and its addition to SummitAdministratorPermissionGroup::ValidGroups.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: the stream group is now accepted in admin access groups, which matches the IGroup::Stream constant and its addition to SummitAdministratorPermissionGroup::ValidGroups. The title is specific and uses the conventional feat(scope) format. The changeset also adds a test class, which the title does not mention, but that is expected for a title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad0af97a-280f-4834-aec6-2836fcc2a7dd
Commits

Reviewing files that changed from the base of the PR and between d8c0633 and 1f67af1.

Files selected for processing: 3

  • app/Models/Foundation/Main/IGroup.php
  • app/Models/Foundation/Main/SummitAdministratorPermissionGroup.php
  • tests/SummitStreamPermissionGroupTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

📘 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.
@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-682/

This page is automatically updated on each push to this PR.

@smarcet
smarcet requested review from romanetar and a balanced review from Copilot and removed request for Copilot November 24, 2026 17:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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::Stream and 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.
@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-682/

This page is automatically updated on each push to this PR.

@romanetar romanetar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet
smarcet merged commit 0f95e33 into main Nov 25, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants