Skip to content

refactor: consolidate template and workspace acl validation #19192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 7, 2025
Prev Previous commit
Next Next commit
:)
  • Loading branch information
aslilac committed Aug 6, 2025
commit e38dcebf6676205da35c6a3662c0dc9490e2dc9c
10 changes: 6 additions & 4 deletions enterprise/coderd/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ func TestUpdateTemplateACL(t *testing.T) {

ctx := testutil.Context(t, testutil.WaitLong)

//nolint:gocritic // we're testing invalid UUID so testing RBAC is not relevant here.
//nolint:gocritic // Testing ACL validation
err := client.UpdateTemplateACL(ctx, template.ID, req)
require.Error(t, err)
cerr, _ := codersdk.AsError(err)
Expand All @@ -1446,7 +1446,7 @@ func TestUpdateTemplateACL(t *testing.T) {

ctx := testutil.Context(t, testutil.WaitLong)

//nolint:gocritic // we're testing invalid UUID so testing RBAC is not relevant here.
//nolint:gocritic // Testing ACL validation
err := client.UpdateTemplateACL(ctx, template.ID, req)
require.Error(t, err)
cerr, _ := codersdk.AsError(err)
Expand All @@ -1472,7 +1472,7 @@ func TestUpdateTemplateACL(t *testing.T) {

ctx := testutil.Context(t, testutil.WaitLong)

//nolint:gocritic // we're testing invalid user so testing RBAC is not relevant here.
//nolint:gocritic // Testing ACL validation
err := client.UpdateTemplateACL(ctx, template.ID, req)
require.Error(t, err)
cerr, _ := codersdk.AsError(err)
Expand All @@ -1496,6 +1496,7 @@ func TestUpdateTemplateACL(t *testing.T) {
ctx := testutil.Context(t, testutil.WaitLong)

_, deletedUser := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
//nolint:gocritic // Can't delete yourself
err := client.DeleteUser(ctx, deletedUser.ID)
require.NoError(t, err)

Expand Down Expand Up @@ -1524,6 +1525,7 @@ func TestUpdateTemplateACL(t *testing.T) {
ctx := testutil.Context(t, testutil.WaitLong)

_, deletedUser := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
//nolint:gocritic // Can't delete yourself
err := client.DeleteUser(ctx, deletedUser.ID)
require.NoError(t, err)

Expand Down Expand Up @@ -1559,7 +1561,7 @@ func TestUpdateTemplateACL(t *testing.T) {

ctx := testutil.Context(t, testutil.WaitLong)

//nolint:gocritic // we're testing invalid role so testing RBAC is not relevant here.
//nolint:gocritic // Testing ACL validation
err := client.UpdateTemplateACL(ctx, template.ID, req)
require.Error(t, err)
cerr, _ := codersdk.AsError(err)
Expand Down
Loading