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

Function CreatePermissions

codersdk/roles.go:180–191  ·  view source on GitHub ↗

CreatePermissions is a helper function to quickly build permissions.

(mapping map[RBACResource][]RBACAction)

Source from the content-addressed store, hash-verified

178
179// CreatePermissions is a helper function to quickly build permissions.
180func CreatePermissions(mapping map[RBACResource][]RBACAction) []Permission {
181 perms := make([]Permission, 0)
182 for t, actions := range mapping {
183 for _, action := range actions {
184 perms = append(perms, Permission{
185 ResourceType: t,
186 Action: action,
187 })
188 }
189 }
190 return perms
191}

Callers 10

TestInsertCustomRolesFunction · 0.92
TestUserMethod · 0.92
TestCreateUserWorkspaceFunction · 0.92
TestTemplatesFunction · 0.92
TestAssignCustomOrgRolesFunction · 0.92
TestTemplateCreateFunction · 0.92

Calls

no outgoing calls

Tested by 10

TestInsertCustomRolesFunction · 0.74
TestUserMethod · 0.74
TestCreateUserWorkspaceFunction · 0.74
TestTemplatesFunction · 0.74
TestAssignCustomOrgRolesFunction · 0.74
TestTemplateCreateFunction · 0.74