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

Function hasRequiredAccess

worker/acl_cache.go:201–210  ·  view source on GitHub ↗

hasRequiredAccess checks if any group in the passed in groups is allowed to perform the operation according to the acl rules stored in groupPerms

(groupPerms map[string]int32, groups []string,
	operation *acl.Operation)

Source from the content-addressed store, hash-verified

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
201func hasRequiredAccess(groupPerms map[string]int32, groups []string,
202 operation *acl.Operation) bool {
203 for _, group := range groups {
204 groupPerm, found := groupPerms[group]
205 if found && (groupPerm&operation.Code != 0) {
206 return true
207 }
208 }
209 return false
210}

Callers 1

hasAccessToPredFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected