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 76e6ac7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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.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 76e6ac7

Please sign in to comment.