Skip to content

Commit

Permalink
Expose DAV permissions on album and places photos
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge authored and backportbot-nextcloud[bot] committed May 9, 2023
1 parent cbae1dd commit 49dbb0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Sabre/Album/PropFindPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PropFindPlugin extends ServerPlugin {
public const LAST_PHOTO_PROPERTYNAME = '{http://nextcloud.org/ns}last-photo';
public const NBITEMS_PROPERTYNAME = '{http://nextcloud.org/ns}nbItems';
public const COLLABORATORS_PROPERTYNAME = '{http://nextcloud.org/ns}collaborators';
public const PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}permissions';

public const TAG_FAVORITE = '_$!<Favorite>!$_';

Expand Down Expand Up @@ -105,6 +106,8 @@ public function propFind(PropFind $propFind, INode $node): void {
$propFind->handle(self::FILE_NAME_PROPERTYNAME, fn () => $node->getFile()->getName());
$propFind->handle(self::FAVORITE_PROPERTYNAME, fn () => $node->isFavorite() ? 1 : 0);
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, fn () => json_encode($this->previewManager->isAvailable($fileInfo)));
// Remove G permission as it does not make sense in the context of photos.
$propFind->handle(FilesPlugin::PERMISSIONS_PROPERTYNAME, fn () => str_replace('G', '', DavUtil::getDavPermissions($node->getFileInfo())));

if ($this->metadataEnabled) {
$propFind->handle(FilesPlugin::FILE_METADATA_SIZE, function () use ($node) {
Expand Down

0 comments on commit 49dbb0d

Please sign in to comment.