Skip to content

Commit e50d80d

Browse files
committed
feat(projects): When adding members check all memberships
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
1 parent 063e952 commit e50d80d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/controlplane/pkg/data/project.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,11 @@ func (r *ProjectRepo) queryMembership(orgID uuid.UUID, projectID uuid.UUID, memb
337337
membership.MemberID(memberID),
338338
membership.ResourceTypeEQ(authz.ResourceTypeProject),
339339
membership.ResourceID(projectID),
340-
membership.ParentIDIsNil(), // Only top-level memberships
340+
// include both direct (parent nil) and indirect (parent not nil) memberships
341+
membership.Or(
342+
membership.ParentIDIsNil(),
343+
membership.ParentIDNotNil(),
344+
),
341345
).WithOrganization()
342346
}
343347

0 commit comments

Comments
 (0)