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

Method withCachedRegoValue

coderd/rbac/astvalue.go:150–154  ·  view source on GitHub ↗

withCachedRegoValue returns a copy of the role with the cachedRegoValue. It does not mutate the underlying role. Avoid using this function if possible, it should only be used if the caller can guarantee the role is static and will never change.

()

Source from the content-addressed store, hash-verified

148// Avoid using this function if possible, it should only be used if the
149// caller can guarantee the role is static and will never change.
150func (role Role) withCachedRegoValue() Role {
151 tmp := role
152 tmp.cachedRegoValue = role.regoValue()
153 return tmp
154}
155
156func (role Role) regoValue() ast.Value {
157 if role.cachedRegoValue != nil {

Callers 1

ReloadBuiltinRolesFunction · 0.80

Calls 1

regoValueMethod · 0.95

Tested by

no test coverage detected