Skip to content

Commit

Permalink
Add WebDAV permission for PurgeRecyle
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Barz <mbarz@owncloud.com>
  • Loading branch information
micbar committed Jun 27, 2023
1 parent e7451a7 commit c978ab8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/add-new-webdav-permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add new WebDAV permissions

We added the permission "PurgeRecycle" to the WebDAV permissions list. I is represented by the capital letter ``P``.

https://github.com/cs3org/reva/pull/4013
5 changes: 5 additions & 0 deletions internal/http/services/owncloud/ocs/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (r *Role) OCSPermissions() Permissions {
// R = Shareable
// M = Mounted
// Z = Deniable (NEW)
// P = Purge from trashbin
func (r *Role) WebDAVPermissions(isDir, isShared, isMountpoint, isPublic bool) string {
var b strings.Builder
if !isPublic && isShared {
Expand Down Expand Up @@ -129,6 +130,10 @@ func (r *Role) WebDAVPermissions(isDir, isShared, isMountpoint, isPublic bool) s
fmt.Fprintf(&b, "Z")
}

if r.CS3ResourcePermissions().PurgeRecycle {
fmt.Fprintf(&b, "P")
}

return b.String()
}

Expand Down

0 comments on commit c978ab8

Please sign in to comment.