From 97dd7638a9c1eedd3b1810b1c0f7d72aba617567 Mon Sep 17 00:00:00 2001 From: Fynn Date: Fri, 17 Mar 2023 09:16:12 +0800 Subject: [PATCH] add more check for message --- x/permission/types/types.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x/permission/types/types.go b/x/permission/types/types.go index 375a18736..1983b3eed 100644 --- a/x/permission/types/types.go +++ b/x/permission/types/types.go @@ -168,6 +168,9 @@ func (s *Statement) Eval(action ActionType, opts *VerifyOptions) (Effect, *State } func (s *Statement) ValidateBasic(resType resource.ResourceType) error { + if s.Effect == EFFECT_PASS { + return ErrInvalidStatement.Wrap("Not allowed to set EFFECT_PASS.") + } switch resType { case resource.RESOURCE_TYPE_BUCKET: containsCreateObject := false