Skip to content

Commit

Permalink
fix publick link update
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Dec 1, 2023
1 parent 96036e1 commit 24c7a1c
Showing 1 changed file with 9 additions and 3 deletions.
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 24c7a1c

Please sign in to comment.