From 047d843f61d258bebf8040022701565fd1cb34fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 8 Feb 2022 15:32:14 +0000 Subject: [PATCH] clarify add/deny grant log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .../grpc/services/gateway/usershareprovider.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/internal/grpc/services/gateway/usershareprovider.go b/internal/grpc/services/gateway/usershareprovider.go index 0d8eced57c..2d40c80ffe 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -83,7 +83,7 @@ func (s *svc) CreateShare(ctx context.Context, req *collaboration.CreateShareReq case rpc.Code_CODE_OK: // ok case rpc.Code_CODE_UNIMPLEMENTED: - appctx.GetLogger(ctx).Debug().Interface("status", status).Interface("req", req).Msg("not supported, ignoring") + appctx.GetLogger(ctx).Debug().Interface("status", status).Interface("req", req).Msg("storing grants not supported, ignoring") default: return &collaboration.CreateShareResponse{ Status: status, @@ -494,12 +494,7 @@ func (s *svc) denyGrant(ctx context.Context, id *provider.ResourceId, g *provide if err != nil { return nil, errors.Wrap(err, "gateway: error calling DenyGrant") } - if grantRes.Status.Code != rpc.Code_CODE_OK { - return status.NewInternal(ctx, - "error committing share to storage grant"), nil - } - - return status.NewOK(ctx), nil + return grantRes.Status, nil } func (s *svc) addGrant(ctx context.Context, id *provider.ResourceId, g *provider.Grantee, p *provider.ResourcePermissions) (*rpc.Status, error) { @@ -531,12 +526,7 @@ func (s *svc) addGrant(ctx context.Context, id *provider.ResourceId, g *provider if err != nil { return nil, errors.Wrap(err, "gateway: error calling AddGrant") } - if grantRes.Status.Code != rpc.Code_CODE_OK { - return status.NewInternal(ctx, - "error committing share to storage grant"), nil - } - - return status.NewOK(ctx), nil + return grantRes.Status, nil } func (s *svc) updateGrant(ctx context.Context, id *provider.ResourceId, g *provider.Grantee, p *provider.ResourcePermissions) (*rpc.Status, error) {