Skip to content

Commit

Permalink
handle sending all permissions when creating public links
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Dec 7, 2021
1 parent 7ac4043 commit 42e238c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/handle-public-link-permissions-all.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: handle sending all permissions when creating public links

For backwards compatability we now reduce permissions to readonly when a create public link carries all permissions.

https://github.com/cs3org/reva/issues/2336
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ func (h *Handler) removePublicShare(w http.ResponseWriter, r *http.Request, shar
}

func ocPublicPermToCs3(permKey int, h *Handler) (*provider.ResourcePermissions, error) {

if permKey == 31 {
// apiSharePublicLink1/createPublicLinkShare.feature:109
// Scenario Outline: Trying to create a new public link share of a file with edit permissions only grants read access using the public WebDAV API
permKey = 1
}

// TODO refactor this ocPublicPermToRole[permKey] check into a conversions.NewPublicSharePermissions?
// not all permissions are possible for public shares
_, ok := ocPublicPermToRole[permKey]
Expand Down

0 comments on commit 42e238c

Please sign in to comment.