MCPcopy Index your code
hub / github.com/coder/coder / roleToTableView

Function roleToTableView

cli/organizationroles.go:502–511  ·  view source on GitHub ↗
(role codersdk.Role)

Source from the content-addressed store, hash-verified

500}
501
502func roleToTableView(role codersdk.Role) roleTableRow {
503 return roleTableRow{
504 Name: role.Name,
505 DisplayName: role.DisplayName,
506 OrganizationID: role.OrganizationID,
507 SitePermissions: fmt.Sprintf("%d permissions", len(role.SitePermissions)),
508 OrganizationPermissions: fmt.Sprintf("%d permissions", len(role.OrganizationPermissions)),
509 UserPermissions: fmt.Sprintf("%d permissions", len(role.UserPermissions)),
510 }
511}
512
513func existingRole(newRoleName string, existingRoles []codersdk.AssignableRoles) *codersdk.AssignableRoles {
514 for _, existingRole := range existingRoles {

Callers 3

showOrganizationRolesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected