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

Function defaultActions

cli/organizationroles.go:466–478  ·  view source on GitHub ↗
(role *codersdk.Role, resource string)

Source from the content-addressed store, hash-verified

464}
465
466func defaultActions(role *codersdk.Role, resource string) []string {
467 if role.OrganizationPermissions == nil {
468 role.OrganizationPermissions = []codersdk.Permission{}
469 }
470
471 defaults := make([]string, 0)
472 for _, perm := range role.OrganizationPermissions {
473 if string(perm.ResourceType) == resource {
474 defaults = append(defaults, string(perm.Action))
475 }
476 }
477 return defaults
478}
479
480func permissionPreviews(role *codersdk.Role, resources []codersdk.RBACResource) []string {
481 previews := make([]string, 0, len(resources))

Callers 1

interactiveOrgRoleEditFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected