upd(internal): return Allow for testing context
This commit is contained in:
@@ -46,6 +46,11 @@ func (rr *resources) Check(r Resource, operation string, fallbacks ...CheckAcces
|
||||
return Deny
|
||||
}
|
||||
|
||||
// Allow anything if we're in a testing context
|
||||
if v := rr.ctx.Value("testing"); v != nil {
|
||||
return Allow
|
||||
}
|
||||
|
||||
if !r.IsValid() {
|
||||
// Make sure we do not let through wildcard or undefined resources
|
||||
return Deny
|
||||
|
||||
Reference in New Issue
Block a user