8000 chore: add edit organization role to cli by Emyrk · Pull Request #13365 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: add edit organization role to cli #13365

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 9 commits into from
Jun 3, 2024
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
linting
  • Loading branch information
Emyrk committed May 31, 2024
commit 57723a6773ae6ad8dc324705972620b8d2f6474f
2 changes: 1 addition & 1 deletion cli/organizationroles.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func roleToTableView(role codersdk.Role) roleTableRow {
Name: role.Name,
DisplayName: role.DisplayName,
SitePermissions: fmt.Sprintf("%d permissions", len(role.SitePermissions)),
OrganizationPermissions: fmt.Sprintf("%s", orgPermissionString(role.OrganizationPermissions)),
OrganizationPermissions: orgPermissionString(role.OrganizationPermissions),
UserPermissions: fmt.Sprintf("%d permissions", len(role.UserPermissions)),
}
}
Expand Down
6 changes: 4 additions & 2 deletions enterprise/cli/organization_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cli
package cli_test

import (
"bytes"
Expand Down Expand Up @@ -31,7 +31,8 @@ func TestEditOrganizationRoles(t *testing.T) {
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
},
}})
},
})

ctx := testutil.Context(t, testutil.WaitMedium)
inv, root := clitest.New(t, "organization", "roles", "edit", "--stdin")
Expand All @@ -53,6 +54,7 @@ func TestEditOrganizationRoles(t *testing.T) {
"assignable": false,
"built_in": false
}`, owner.OrganizationID.String()))
//nolint:gocritic // only owners can edit roles
clitest.SetupConfig(t, client, root)

buf := new(bytes.Buffer)
Expand Down
0