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

Function roleCache

coderd/rbac/rolestore/rolestore.go:35–41  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

33}
34
35func roleCache(ctx context.Context) *syncmap.Map[string, rbac.Role] {
36 c, ok := ctx.Value(customRoleCtxKey{}).(*syncmap.Map[string, rbac.Role])
37 if !ok {
38 return syncmap.New[string, rbac.Role]()
39 }
40 return c
41}
42
43// Expand will expand built in roles, and fetch custom roles from the database.
44// If a custom role is defined, but does not exist, the role will be omitted on

Callers 1

ExpandFunction · 0.85

Calls 2

NewFunction · 0.92
ValueMethod · 0.45

Tested by

no test coverage detected