Skip to content

Commit

Permalink
fix: default policy
Browse files Browse the repository at this point in the history
  • Loading branch information
gassara-kys committed Apr 16, 2024
1 parent 2e3fcbb commit 5181026
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/server/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ func (p *ProjectService) createDefaultRole(ctx context.Context, ownerUserID, pro
findingEditor := "finding-editor"
viewerActionPtn := "get|list|is-admin|put-alert-first-viewed-at"

for name, actionPtn := range map[string]string{projectAdmin: ".*", projectViewer: viewerActionPtn, findingEditor: viewerActionPtn + "|/finding/.+|/alert/.+"} {
for name, actionPtn := range map[string]string{
projectAdmin: ".*",
projectViewer: viewerActionPtn,
findingEditor: viewerActionPtn + "|^finding/.+|^alert/.+",
} {
policy, err := p.iamClient.PutPolicy(ctx, &iam.PutPolicyRequest{
ProjectId: projectID,
Policy: &iam.PolicyForUpsert{
Expand Down

0 comments on commit 5181026

Please sign in to comment.