authorize/evaluator: fix wrong custom policies decision (#1199)

Test will be added in #1198
This commit is contained in:
Cuong Manh Le 2020-08-04 21:11:59 +07:00 committed by GitHub
parent 01d0f7de6e
commit 79b5ae7d98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,7 +163,7 @@ func (e *Evaluator) Evaluate(ctx context.Context, req *Request) (*Result, error)
if err != nil {
return nil, err
}
allow = allow && (!cres.Allowed || cres.Denied)
allow = allow && (cres.Allowed && !cres.Denied)
if cres.Reason != "" {
evalResult.Message = cres.Reason
}