From f716fd31730c4fff9c18bcf05fc1d1ea64b3b468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 18 Jul 2022 09:01:34 +0000 Subject: [PATCH 1/6] revert logic change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/storage/utils/decomposedfs/spaces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/utils/decomposedfs/spaces.go b/pkg/storage/utils/decomposedfs/spaces.go index 2491f782fb..7e93404b90 100644 --- a/pkg/storage/utils/decomposedfs/spaces.go +++ b/pkg/storage/utils/decomposedfs/spaces.go @@ -282,7 +282,7 @@ func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provide return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to list spaces of other users", ctxpkg.ContextMustGetUser(ctx).GetId().GetOpaqueId())) } - checkNodePermissions := !canListAllSpaces && !unrestricted + checkNodePermissions := !canListAllSpaces || !unrestricted spaces := []*provider.StorageSpace{} // build the glob path, eg. From 25709d7486d10fa029d550f5b69973c33cb9f87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 18 Jul 2022 09:01:46 +0000 Subject: [PATCH 2/6] fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/storage/utils/decomposedfs/tree/tree.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/storage/utils/decomposedfs/tree/tree.go b/pkg/storage/utils/decomposedfs/tree/tree.go index bea5b8b399..71c3c586b2 100644 --- a/pkg/storage/utils/decomposedfs/tree/tree.go +++ b/pkg/storage/utils/decomposedfs/tree/tree.go @@ -154,7 +154,7 @@ func (t *Tree) moveSpaceType(spaceType string) error { Str("space", spaceType). Str("nodes", child.Name()). Str("oldLink", old). - Msg("could not read old symplink") + Msg("could not read old symlink") continue } newDir := filepath.Join(t.root, "indexes", "by-type", spaceType) @@ -163,7 +163,7 @@ func (t *Tree) moveSpaceType(spaceType string) error { Str("space", spaceType). Str("nodes", child.Name()). Str("targetDir", newDir). - Msg("could not read old symplink") + Msg("could not read old symlink") } newLink := filepath.Join(newDir, child.Name()) if err := os.Symlink(filepath.Join("..", target), newLink); err != nil { From 93f2d85a7367fb5e168cc677620595615af8e8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 18 Jul 2022 09:04:28 +0000 Subject: [PATCH 3/6] fix v2.7.1 changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- CHANGELOG.md | 4 ++-- changelog/2.7.1_2022-07-15/add-user-filter.md | 2 +- changelog/NOTE.md | 4 ++-- docs/content/en/docs/changelog/2.7.1/_index.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02aed5fdba..89a390b8a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -153,11 +153,11 @@ Details https://github.com/owncloud/reva/issues/3080 - * Enhancement #4072: Add user filter + * Enhancement #3046: Add user filter This PR adds the ability to filter spaces by user-id - https://github.com/owncloud/ocis/pull/4072 + https://github.com/cs3org/reva/pull/3046 Changelog for reva 2.6.1 (2022-06-27) diff --git a/changelog/2.7.1_2022-07-15/add-user-filter.md b/changelog/2.7.1_2022-07-15/add-user-filter.md index 9f8ebe91b0..664e550283 100644 --- a/changelog/2.7.1_2022-07-15/add-user-filter.md +++ b/changelog/2.7.1_2022-07-15/add-user-filter.md @@ -2,4 +2,4 @@ Enhancement: Add user filter This PR adds the ability to filter spaces by user-id -https://github.com/owncloud/ocis/pull/4072 \ No newline at end of file +https://github.com/cs3org/reva/pull/3046 \ No newline at end of file diff --git a/changelog/NOTE.md b/changelog/NOTE.md index 0db0828f9a..992af6e0b3 100644 --- a/changelog/NOTE.md +++ b/changelog/NOTE.md @@ -20,10 +20,10 @@ Details https://github.com/owncloud/reva/issues/3080 - * Enhancement #4072: Add user filter + * Enhancement #3046: Add user filter This PR adds the ability to filter spaces by user-id - https://github.com/owncloud/ocis/pull/4072 + https://github.com/cs3org/reva/pull/3046 diff --git a/docs/content/en/docs/changelog/2.7.1/_index.md b/docs/content/en/docs/changelog/2.7.1/_index.md index 2ce37e68e6..16493e8a6e 100644 --- a/docs/content/en/docs/changelog/2.7.1/_index.md +++ b/docs/content/en/docs/changelog/2.7.1/_index.md @@ -29,10 +29,10 @@ Details https://github.com/owncloud/reva/issues/3080 - * Enhancement #4072: Add user filter + * Enhancement #3046: Add user filter This PR adds the ability to filter spaces by user-id - https://github.com/owncloud/ocis/pull/4072 + https://github.com/cs3org/reva/pull/3046 From caca92fefadfca6ae7a87f9ccbb3702a7ad833ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 18 Jul 2022 09:09:07 +0000 Subject: [PATCH 4/6] add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-can-list-all-spaces-permission.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/unreleased/fix-can-list-all-spaces-permission.md diff --git a/changelog/unreleased/fix-can-list-all-spaces-permission.md b/changelog/unreleased/fix-can-list-all-spaces-permission.md new file mode 100644 index 0000000000..21ab69655c --- /dev/null +++ b/changelog/unreleased/fix-can-list-all-spaces-permission.md @@ -0,0 +1,5 @@ +Bugfix: Fix can list all spaces permission + +We reverted a logic check when checking the list all spaces permission. + +https://github.com/cs3org/reva/pull/3084 From 9e683197d0f3bd17af4941ac2732a6f46ec77f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 18 Jul 2022 10:44:33 +0000 Subject: [PATCH 5/6] fill in storage provider id if it is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- internal/grpc/services/storageprovider/storageprovider.go | 4 ++++ pkg/rhttp/datatx/utils/download/download.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index 950e55f441..5676cf3ef7 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -265,6 +265,10 @@ func (s *service) InitiateFileDownload(ctx context.Context, req *provider.Initia protocol := &provider.FileDownloadProtocol{Expose: s.conf.ExposeDataServer} if utils.IsRelativeReference(req.Ref) { + // fill in storage provider id if it is missing + if req.GetRef().GetResourceId().GetStorageId() == "" { + req.GetRef().GetResourceId().StorageId = s.conf.MountID + } protocol.Protocol = "spaces" u.Path = path.Join(u.Path, "spaces", storagespace.FormatResourceID(*req.Ref.ResourceId), req.Ref.Path) } else { diff --git a/pkg/rhttp/datatx/utils/download/download.go b/pkg/rhttp/datatx/utils/download/download.go index aa34bd73dd..bf9cd76dd6 100644 --- a/pkg/rhttp/datatx/utils/download/download.go +++ b/pkg/rhttp/datatx/utils/download/download.go @@ -80,6 +80,11 @@ func GetOrHeadFile(w http.ResponseWriter, r *http.Request, fs storage.FS, spaceI return } + // fill in storage provider id if it is missing + if spaceID != "" && md.GetId().GetStorageId() == "" { + md.Id.StorageId = ref.ResourceId.StorageId + } + var ranges []HTTPRange if r.Header.Get("Range") != "" { From 0104218bbd75d44775f36b1774f91daef42c7a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 18 Jul 2022 12:13:37 +0000 Subject: [PATCH 6/6] update changelog reflect all commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-can-list-all-spaces-permission.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/fix-can-list-all-spaces-permission.md b/changelog/unreleased/fix-can-list-all-spaces-permission.md index 21ab69655c..2d2d841ebb 100644 --- a/changelog/unreleased/fix-can-list-all-spaces-permission.md +++ b/changelog/unreleased/fix-can-list-all-spaces-permission.md @@ -1,5 +1,5 @@ -Bugfix: Fix can list all spaces permission +Bugfix: spaces relatated permissions and providerid cleanup -We reverted a logic check when checking the list all spaces permission. +Following the CS3 resource id refactoring we reverted a logic check when checking the list all spaces permission, fixed some typos and made the storageprovider fill in a missing storage provider id. https://github.com/cs3org/reva/pull/3084