Skip to content

Commit

Permalink
Merge pull request #360 from ca-risken/fix-policy
Browse files Browse the repository at this point in the history
fix: default policy
  • Loading branch information
gassara-kys authored Apr 16, 2024
2 parents 2e3fcbb + 5181026 commit 3900380
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 3900380

Please sign in to comment.