[#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 <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-24 15:21:41 +03:00 committed by Alex Vanin
parent 8cedb93cea
commit cf1ea983e5

View file

@ -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()),
)