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

Fix permissions for the "uploader" Role #3274

Merged
merged 1 commit into from
Sep 26, 2022
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
8 changes: 8 additions & 0 deletions changelog/unreleased/fix-uploader-permissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Fix "uploader" role permissions

We fixed a permission problem on "public upload shares", which allowed to
view the content of the shared upload folder.


https://github.com/cs3org/reva/pull/3274
https://github.com/owncloud/ocis/issues/4657
5 changes: 1 addition & 4 deletions internal/http/services/owncloud/ocs/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ func NewUploaderRole() *Role {
Name: RoleUploader,
cS3ResourcePermissions: &provider.ResourcePermissions{
Stat: true,
ListContainer: true,
GetPath: true,
CreateContainer: true,
InitiateFileUpload: true,
Expand Down Expand Up @@ -368,7 +367,6 @@ func NewLegacyRoleFromOCSPermissions(p Permissions) *Role {
}
if p.Contain(PermissionCreate) {
r.cS3ResourcePermissions.Stat = true
r.cS3ResourcePermissions.ListContainer = true
r.cS3ResourcePermissions.CreateContainer = true
// FIXME permissions mismatch: double check ocs create vs update file
// - if the file exists the ocs api needs to check update permission,
Expand Down Expand Up @@ -414,8 +412,7 @@ func RoleFromResourcePermissions(rp *provider.ResourcePermissions) *Role {
rp.RestoreRecycleItem {
r.ocsPermissions |= PermissionWrite
}
if rp.ListContainer &&
rp.Stat &&
if rp.Stat &&
rp.CreateContainer &&
rp.InitiateFileUpload {
r.ocsPermissions |= PermissionCreate
Expand Down