Skip to content

Commit

Permalink
fix public link update
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Dec 7, 2023
1 parent 7b47abd commit 59bfd5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-publick-link-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix the public link update

We fixed a bug when normal users can update the public link to delete its password if permission is not sent in data.

https://github.com/cs3org/reva/pull/4380
https://github.com/owncloud/ocis/issues/7821
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,15 @@ func (h *Handler) updatePublicShare(w http.ResponseWriter, r *http.Request, shar
}

// empty permissions mean internal link here - NOT denial. Hence we need an extra check
if !sufficientPermissions(statRes.GetInfo().GetPermissionSet(), newPermissions, true) {
response.WriteOCSError(w, r, http.StatusForbidden, "no share permission", nil)
return
if newPermissions != nil {
if !sufficientPermissions(statRes.GetInfo().GetPermissionSet(), newPermissions, true) {
response.WriteOCSError(w, r, http.StatusForbidden, "no share permission", nil)
return
}
} else {
statRes.GetInfo().GetPermissionSet()
p := decreasePermissionsIfNecessary(int(conversions.RoleFromResourcePermissions(statRes.GetInfo().GetPermissionSet(), false).OCSPermissions()))
permKey = &p
}

// ExpireDate
Expand Down

0 comments on commit 59bfd5e

Please sign in to comment.