Skip to content

Commit

Permalink
fix: list project admins to fetch shield/project:owner role (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
utsav14nov authored Sep 19, 2024
1 parent 206c2fd commit beee146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/store/postgres/project_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/goto/shield/core/namespace"
"github.com/goto/shield/core/organization"
"github.com/goto/shield/core/project"
"github.com/goto/shield/core/role"
"github.com/goto/shield/core/user"
"github.com/goto/shield/internal/schema"
"github.com/goto/shield/pkg/db"
newrelic "github.com/newrelic/go-agent/v3/newrelic"
"go.nhat.io/otelsql"
Expand Down Expand Up @@ -412,7 +412,7 @@ func (r ProjectRepository) ListAdmins(ctx context.Context, projectID string) ([]
goqu.I("u.id").Cast("VARCHAR").Eq(goqu.I("r.subject_id")),
)).Where(goqu.Ex{
"r.object_id": projectID,
"r.role_id": role.DefinitionProjectAdmin.ID,
"r.role_id": schema.GetRoleID(schema.ProjectNamespace, schema.OwnerRole),
"r.subject_namespace_id": namespace.DefinitionUser.ID,
"r.object_namespace_id": namespace.DefinitionProject.ID,
}).ToSQL()
Expand Down

0 comments on commit beee146

Please sign in to comment.