MCPcopy
hub / github.com/dgraph-io/dgraph / hasAccessToPred

Function hasAccessToPred

worker/acl_cache.go:186–197  ·  view source on GitHub ↗
(pred string, groups []string, operation *acl.Operation)

Source from the content-addressed store, hash-verified

184}
185
186func hasAccessToPred(pred string, groups []string, operation *acl.Operation) bool {
187 AclCachePtr.RLock()
188 defer AclCachePtr.RUnlock()
189 predPerms := AclCachePtr.predPerms
190
191 if groupPerms, found := predPerms[pred]; found {
192 if hasRequiredAccess(groupPerms, groups, operation) {
193 return true
194 }
195 }
196 return false
197}
198
199// hasRequiredAccess checks if any group in the passed in groups is allowed to perform the operation
200// according to the acl rules stored in groupPerms

Callers 2

AuthorizePredicateMethod · 0.85
HasAccessToAllPredsFunction · 0.85

Calls 3

hasRequiredAccessFunction · 0.85
RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected