From 4c665a7f03acd4b599ab4a9edfa0cbcbe5b77dd2 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 15 Nov 2023 18:23:30 +0100 Subject: [PATCH] Another fix for converting custom ocs permissions to roles When creating (public) shares with the permissions read,update,create,delete we wrongly converted that into the `SpacerEditor` sharing role. The correct role for that would be `legacy`. Fixes: https://github.com/owncloud/enterprise/issues/6209 --- changelog/unreleased/fix-roleconversion-custompermissions.md | 5 +++-- pkg/conversions/role.go | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog/unreleased/fix-roleconversion-custompermissions.md b/changelog/unreleased/fix-roleconversion-custompermissions.md index 9f7b8de987..f86f13482a 100644 --- a/changelog/unreleased/fix-roleconversion-custompermissions.md +++ b/changelog/unreleased/fix-roleconversion-custompermissions.md @@ -1,7 +1,8 @@ Bugfix: Fix conversion of custom ocs permissions to roles -When creating shares with just `view` permission we wrongly converted that -into the `SpacerViewer` sharing role. The correct role for that would be `legacy`. +When creating shares with custom permissions they were under certain conditions +converted into the wrong corrensponding sharing role +https://github.com/cs3org/reva/pull/4343 https://github.com/cs3org/reva/pull/4342 https://github.com/owncloud/enterprise/issues/6209 diff --git a/pkg/conversions/role.go b/pkg/conversions/role.go index c4593565e1..4b323a9aed 100644 --- a/pkg/conversions/role.go +++ b/pkg/conversions/role.go @@ -389,7 +389,9 @@ func RoleFromOCSPermissions(p Permissions, ri *provider.ResourceInfo) *Role { return NewEditorRole(true) } - return NewSpaceEditorRole() + if isSpaceRoot(ri) { + return NewSpaceEditorRole() + } } if p == PermissionRead && isSpaceRoot(ri) {