Skip to content

fix(controlplane): authorize GroupService/ListProjects at the service layer - #3293

Closed
matiasinsaurralde wants to merge 1 commit into
mainfrom
fix/group-listprojects-authz-v1
Closed

fix(controlplane): authorize GroupService/ListProjects at the service layer#3293
matiasinsaurralde wants to merge 1 commit into
mainfrom
fix/group-listprojects-authz-v1

Conversation

@matiasinsaurralde

@matiasinsaurralde matiasinsaurralde commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes PFM-6695

Summary

GroupService/ListProjects was the only group sub-resource handler that resolved results without a service-layer permission check, relying solely on the visibleProjects row filter. That filter returns nil ("RBAC not applied") for legacy RoleViewer users and for org-scoped API tokens, and the data layer treats nil as "no filter" — so those callers received the full group→project attachment map that the design restricts to org admins/maintainers.

This change adds the same PolicyGroupListMemberships guard the sibling handlers already use before resolving projects, matching the earlier ListMembers fix.

Review in cubic

… layer

ListProjects was the only group sub-resource handler that resolved results without
a service-layer permission check, relying solely on the visibleProjects row filter.
That filter returns nil ("RBAC not applied") for a legacy RoleViewer and for
org-scoped API tokens, and the data layer treats nil as "no filter", so those
callers received the full group->project attachment map that the design restricts
to org admins/maintainers.

Add the same userHasPermissionOnGroupMembershipsWithPolicy guard the sibling
handlers use (PolicyGroupListMemberships) before resolving projects, matching the
ListMembers fix.

Chainloop-Trace-Sessions: ebb05958-d85c-4d2e-9f65-5cd74dac91ee

Signed-off-by: Matías Insaurralde <matias@chainloop.dev>
@chainloop-platform

Copy link
Copy Markdown
Contributor

AI Session Analysis

Missing AI Coding Sessions

We detected commits in this PR that were AI-assisted, but the matching Chainloop Trace session(s) could not be found in Chainloop.

Please make sure the AI coding session evidence has been sent by the Chainloop CLI, or add the skip-ai-session label to this PR to bypass this check.

Learn more about Chainloop Trace.


Powered by Chainloop and Chainloop Trace

@matiasinsaurralde
matiasinsaurralde marked this pull request as ready for review July 16, 2026 23:54

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@matiasinsaurralde
matiasinsaurralde requested a review from a team July 17, 2026 00:10
@jiparis

jiparis commented Jul 17, 2026

Copy link
Copy Markdown
Member

Current behaviour is fine: All users can list groups, and they can also see which of their projects are attached to those groups. User membership is hidden though.

@jiparis jiparis closed this Jul 17, 2026
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.

2 participants