From 7ea763373eb2c49c7b3dab57913030126132991b Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Wed, 3 Apr 2019 13:47:33 +0200 Subject: [PATCH] upd(internal): return Allow for testing context --- internal/rules/resources.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/rules/resources.go b/internal/rules/resources.go index e153edc7c..2fafb0319 100644 --- a/internal/rules/resources.go +++ b/internal/rules/resources.go @@ -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