10000 fix: improve error message when deleting organization with resources by brettkolodny · Pull Request #17049 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: improve error message when deleting organization with resources #17049

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: change permissions
  • Loading branch information
brettkolodny committed Mar 21, 2025
commit 4cfd54c23825b3061f833ad645f059eaced9eb7c
4 changes: 2 additions & 2 deletions coderd/database/dbauthz/dbauthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -2006,8 +2006,8 @@ func (q *querier) GetOrganizationResourceCountByID(ctx context.Context, organiza
return database.GetOrganizationResourceCountByIDRow{}, err
}

// Can read org provisioner jobs
if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceProvisionerJobs.InOrg(organizationID)); err != nil {
// Can read org provisioner daemons
if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceProvisionerDaemon.InOrg(organizationID)); err != nil {
return database.GetOrganizationResourceCountByIDRow{}, err
}

Expand Down
2 changes: 1 addition & 1 deletion coderd/database/dbauthz/dbauthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ func (s *MethodTestSuite) TestOrganization() {
rbac.ResourceWorkspace.InOrg(o.ID), policy.ActionRead,
rbac.ResourceGroup.InOrg(o.ID), policy.ActionRead,
rbac.ResourceTemplate.InOrg(o.ID), policy.ActionRead,
rbac.ResourceProvisionerJobs.InOrg(o.ID), policy.ActionRead,
rbac.ResourceProvisionerDaemon.InOrg(o.ID), policy.ActionRead,
).Returns(database.GetOrganizationResourceCountByIDRow{
WorkspaceCount: 1,
GroupCount: 1,
Expand Down
Loading
0