Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another fix for converting custom ocs permissions to roles #4343

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/4343
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog check fails because 4343 needs to be on top of the list.

https://github.com/cs3org/reva/pull/4342
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