Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controlplane/api/controlplane/v1/project.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/controlplane/api/controlplane/v1/project.proto
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ message ProjectMember {
google.protobuf.Timestamp updated_at = 5;
// The ID of latest project version this member is associated with
string latest_project_version_id = 6;
// Optional parent ID for nested project memberships
// Optional parent resource ID for nested project memberships
optional string parent_id = 7;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/controlplane/internal/service/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ func bizProjectMembershipToPb(m *biz.ProjectMembership) *pb.ProjectMember {
Role: role,
}

if m.ParentID != nil {
pbMember.ParentId = biz.ToPtr(m.ParentID.String())
if m.ParentResourceID != nil {
pbMember.ParentId = biz.ToPtr(m.ParentResourceID.String())
}

if m.User != nil {
Expand Down
4 changes: 3 additions & 1 deletion app/controlplane/pkg/biz/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ type ProjectMembership struct {
CreatedAt *time.Time
// UpdatedAt is the timestamp when the membership was last updated.
UpdatedAt *time.Time
// ParentID is used for nested memberships, if applicable
// ParentID is the parent membership object used for nested memberships, if applicable
ParentID *uuid.UUID
// ParentResourceID identifies the parent resource of this membership, if applicable
ParentResourceID *uuid.UUID
}

// GroupProjectInfo represents detailed information about a project that a group is a member of
Expand Down
7 changes: 6 additions & 1 deletion app/controlplane/pkg/data/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (r *ProjectRepo) ListMembers(ctx context.Context, orgID uuid.UUID, projectI
Where(
membership.ResourceTypeEQ(authz.ResourceTypeProject),
membership.ResourceID(projectID),
)
).WithParent()

// Get total count before applying pagination
totalCount, err := query.Count(ctx)
Expand Down Expand Up @@ -362,6 +362,11 @@ func entProjectMembershipToBiz(m *ent.Membership, u *ent.User, g *ent.Group) *bi
ParentID: m.ParentID,
}

// Add the parent resource ID if it exists
if m.Edges.Parent != nil {
mem.ParentResourceID = &m.Edges.Parent.ResourceID
}

if u != nil {
mem.User = entUserToBizUser(u)
}
Expand Down
Loading