Skip to content

Commit

Permalink
fix(ocs): ignore resharing permissions when sharing
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Aug 20, 2024
1 parent 774910f commit 0feafae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/ignore-resharing-requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Ignore resharing requests

We now ignore resharing permissions. Instead of returning BadRequest we just reduce the permissions.

https://github.com/cs3org/reva/pull/4816
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ func (h *Handler) CreateShare(w http.ResponseWriter, r *http.Request) {
reqRole, reqPermissions := r.FormValue("role"), r.FormValue("permissions")
switch shareType {
case int(conversions.ShareTypeUser), int(conversions.ShareTypeGroup):
// user collaborations default to Manager (=all permissions)
// NOTE: clients tend to send "31" as permissions but they mean "15". "31" is no longer allowed as we have no resharing any more.
if reqRole == "" && reqPermissions == "31" {
reqPermissions = "15"
}

// user collaborations default to Manager (=all permissions). This will result in a BadRequest. Sane Default.
role, val, ocsErr := h.extractPermissions(reqRole, reqPermissions, statRes.Info, conversions.NewManagerRole())
if ocsErr != nil {
response.WriteOCSError(w, r, ocsErr.Code, ocsErr.Message, ocsErr.Error)
Expand Down

0 comments on commit 0feafae

Please sign in to comment.