Skip to content

Commit a4f72ec

Browse files
committed
proxy: correct release permission error message
1 parent 072761b commit a4f72ec

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

internal/gateway/proxy/helpers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ func forbiddenMessage(resource rbac.Resource, action rbac.Action) string {
171171
}
172172
case rbac.ResourceRelease:
173173
switch action {
174-
case rbac.ActionCreate, rbac.ActionPromote:
174+
case rbac.ActionCreate:
175+
return "You don't have permission to create releases."
176+
case rbac.ActionPromote:
175177
return "You don't have permission to promote releases."
176178
}
177179
}

internal/integration/integration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,8 @@ func testProxyE2EUnauthorized(t *testing.T, s *TestServers) {
684684
require.Error(t, err, "ops should be blocked from setting env vars")
685685
assert.True(
686686
t,
687-
strings.Contains(string(output), "You don't have permission to promote releases.") ||
687+
strings.Contains(string(output), "You don't have permission to create releases.") ||
688+
strings.Contains(string(output), "You don't have permission to promote releases.") ||
688689
strings.Contains(string(output), "MFA"),
689690
"should be blocked: %s",
690691
output,

0 commit comments

Comments
 (0)