Skip to content

Commit

Permalink
Another fix for converting custom ocs permissions to roles
Browse files Browse the repository at this point in the history
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: owncloud/enterprise#6209
  • Loading branch information
rhafer committed Nov 15, 2023
1 parent 9fa275e commit 73818e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions changelog/unreleased/fix-roleconversion-custompermissions.md
Original file line number Diff line number Diff line change
@@ -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/4342
https://github.com/cs3org/reva/pull/4343
https://github.com/owncloud/enterprise/issues/6209
4 changes: 3 additions & 1 deletion pkg/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 73818e2

Please sign in to comment.