MCPcopy
hub / github.com/perkeep/perkeep / AllowedWithAuth

Function AllowedWithAuth

pkg/auth/auth.go:342–348  ·  view source on GitHub ↗

AllowedWithAuth returns whether the given request has access to perform all the operations in op against am.

(am AuthMode, req *http.Request, op Operation)

Source from the content-addressed store, hash-verified

340// has access to perform all the operations in op
341// against am.
342func AllowedWithAuth(am AuthMode, req *http.Request, op Operation) bool {
343 if op&OpUpload != 0 {
344 // upload (at least from pk-put) requires stat and get too
345 op = op | OpVivify
346 }
347 return am.AllowedAccess(req)&op == op
348}
349
350// Allowed returns whether the given request
351// has access to perform all the operations in op.

Callers 2

ServeHTTPMethod · 0.92
AllowedFunction · 0.85

Calls 1

AllowedAccessMethod · 0.65

Tested by

no test coverage detected