Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single file edit #2743

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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