From cf1ea983e547d9b33ba0111e74c070f1a32e0fd6 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 24 Nov 2020 15:21:41 +0300 Subject: [PATCH] [#203] Do not fail eACL check on EACLNotFound error Now morph library returns error if there is not eACL in sidechain storage. However in this case eACL check should be passed since it is the same as having empty eACL table. Signed-off-by: Alex Vanin --- pkg/services/object/acl/eacl/validator.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/services/object/acl/eacl/validator.go b/pkg/services/object/acl/eacl/validator.go index f0179b74f..c9cd709ad 100644 --- a/pkg/services/object/acl/eacl/validator.go +++ b/pkg/services/object/acl/eacl/validator.go @@ -2,9 +2,11 @@ package eacl import ( "bytes" + "errors" "github.com/nspcc-dev/neofs-api-go/pkg/acl/eacl" crypto "github.com/nspcc-dev/neofs-crypto" + "github.com/nspcc-dev/neofs-node/pkg/morph/client/container/wrapper" "github.com/nspcc-dev/neofs-node/pkg/util/logger" "go.uber.org/zap" ) @@ -66,6 +68,10 @@ func (v *Validator) CalculateAction(unit *ValidationUnit) eacl.Action { // get eACL table by container ID table, err = v.storage.GetEACL(unit.cid) if err != nil { + if errors.Is(err, wrapper.ErrEACLNotFound) { + return eacl.ActionAllow + } + v.logger.Error("could not get eACL table", zap.String("error", err.Error()), )