From a579afbaf49dae4caf666803f9c042ee6b24b78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Mon, 9 Oct 2023 09:26:25 +0200 Subject: [PATCH] Fix accessing ocm shares --- .../services/publicstorageprovider/publicstorageprovider.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/grpc/services/publicstorageprovider/publicstorageprovider.go b/internal/grpc/services/publicstorageprovider/publicstorageprovider.go index 205e06071d..4704c5e02a 100644 --- a/internal/grpc/services/publicstorageprovider/publicstorageprovider.go +++ b/internal/grpc/services/publicstorageprovider/publicstorageprovider.go @@ -966,9 +966,11 @@ func (s *service) resolveToken(ctx context.Context, share interface{}) (*provide return nil, nil, errtypes.NewErrtypeFromStatus(gsr.Status) } accessMethods := gsr.GetShare().GetAccessMethods() - if accessMethods == nil || len(accessMethods) > 0 { + if len(accessMethods) == 0 { return nil, nil, errtypes.PermissionDenied("failed to get access to the requested resource") } + resolvedShare = gsr.GetShare() + resourceID = gsr.GetShare().GetResourceId() perms = accessMethods[0].GetWebdavOptions().Permissions }