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

Method WithCachedASTValue

coderd/rbac/authz.go:133–140  ·  view source on GitHub ↗

WithCachedASTValue can be called if the subject is static. This will compute the ast value once and cache it for future calls.

()

Source from the content-addressed store, hash-verified

131// WithCachedASTValue can be called if the subject is static. This will compute
132// the ast value once and cache it for future calls.
133func (s Subject) WithCachedASTValue() Subject {
134 tmp := s
135 v, err := tmp.regoValue()
136 if err == nil {
137 tmp.cachedASTValue = v
138 }
139 return tmp
140}
141
142func (s Subject) Equal(b Subject) bool {
143 if s.ID != b.ID {

Callers 9

UserRBACSubjectFunction · 0.80
MemberSubjectFunction · 0.80
AuthzUserSubjectWithDBFunction · 0.80
benchmarkUserCasesFunction · 0.80
TestRolePermissionsFunction · 0.80
dbauthz.goFile · 0.80
userSkillContextFunction · 0.80
pgcoord.goFile · 0.80

Calls 1

regoValueMethod · 0.65

Tested by 3

benchmarkUserCasesFunction · 0.64
TestRolePermissionsFunction · 0.64