Skip to content

Commit

Permalink
Merge pull request #3934 from micbar/fix-editor-permissions
Browse files Browse the repository at this point in the history
fix wrong space editor permission
  • Loading branch information
micbar authored Jun 5, 2023
2 parents e841425 + 950a0a1 commit 0003b7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-space-editor-permissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix the space editor permissions

We fixed the permissions of a space editor which accidentally granted the permission to purge the trash bin.

https://github.com/cs3org/reva/pull/3934
6 changes: 1 addition & 5 deletions internal/http/services/owncloud/ocs/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ func NewEditorRole(sharing bool) *Role {
ListContainer: true,
ListRecycle: true,
Move: true,
PurgeRecycle: true,
RestoreRecycleItem: true,
Stat: true,
},
Expand All @@ -255,7 +254,6 @@ func NewSpaceEditorRole() *Role {
ListGrants: true,
ListRecycle: true,
Move: true,
PurgeRecycle: true,
RestoreFileVersion: true,
RestoreRecycleItem: true,
Stat: true,
Expand Down Expand Up @@ -400,7 +398,6 @@ func NewLegacyRoleFromOCSPermissions(p Permissions) *Role {
}
if p.Contain(PermissionDelete) {
r.cS3ResourcePermissions.Delete = true
r.cS3ResourcePermissions.PurgeRecycle = true
}
if p.Contain(PermissionShare) {
r.cS3ResourcePermissions.AddGrant = true
Expand Down Expand Up @@ -446,8 +443,7 @@ func RoleFromResourcePermissions(rp *provider.ResourcePermissions, islink bool)
rp.InitiateFileUpload {
r.ocsPermissions |= PermissionCreate
}
if rp.Delete &&
rp.PurgeRecycle {
if rp.Delete {
r.ocsPermissions |= PermissionDelete
}
if rp.AddGrant {
Expand Down

0 comments on commit 0003b7f

Please sign in to comment.