Skip to content

Commit

Permalink
fix webdav permissions for single file public shares
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Apr 14, 2022
1 parent 120c059 commit 6ac8212
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/single-file-edit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add capability for public link single file edit

It is now possible to share a single file by link with edit permissions. Therefore we need a public share capability to enable that feature in the clients. At the same time we improved the WebDAV permissions for public links.

https://github.com/cs3org/reva/pull/2743
5 changes: 4 additions & 1 deletion internal/http/services/owncloud/ocs/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ func (r *Role) WebDAVPermissions(isDir, isShared, isMountpoint, isPublic bool) s
fmt.Fprintf(&b, "D") // TODO oc10 shows received shares as deletable
}
if r.ocsPermissions.Contain(PermissionWrite) {
fmt.Fprintf(&b, "NV")
// Single file public link shares cannot be renamed
if !isPublic || (isPublic && r.cS3ResourcePermissions != nil && r.cS3ResourcePermissions.Move) {
fmt.Fprintf(&b, "NV")
}
if !isDir {
fmt.Fprintf(&b, "W")
}
Expand Down
1 change: 1 addition & 0 deletions internal/http/services/owncloud/ocs/data/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ type CapabilitiesFilesSharingPublic struct {
SupportsUploadOnly ocsBool `json:"supports_upload_only" xml:"supports_upload_only" mapstructure:"supports_upload_only"`
Password *CapabilitiesFilesSharingPublicPassword `json:"password" xml:"password"`
ExpireDate *CapabilitiesFilesSharingPublicExpireDate `json:"expire_date" xml:"expire_date" mapstructure:"expire_date"`
CanEdit ocsBool `json:"can_edit" xml:"can_edit" mapstructure:"can_edit"`
}

// CapabilitiesFilesSharingPublicPassword TODO document
Expand Down

0 comments on commit 6ac8212

Please sign in to comment.