3
0

upd(internal): return Allow for testing context

This commit is contained in:
Tit Petric
2019-04-03 13:47:33 +02:00
parent a173071bbc
commit 7ea763373e
+5
View File
@@ -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