debug(ShareAPIController): Add log statements for manipulation of download permission

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2025-08-04 08:13:41 +02:00
parent 286c10c8b9
commit c04d4e8c68

View file

@ -2038,6 +2038,13 @@ class ShareAPIController extends OCSController {
$formattedShareAttributes = \json_decode($attributesString, true);
if (is_array($formattedShareAttributes)) {
foreach ($formattedShareAttributes as $formattedAttr) {
if ($formattedAttr['scope'] === 'permissions' && $formattedAttr['key'] === 'download') {
try {
$this->logger->warning('Setting download permission on share', ['share_path' => $share->getNode()->getInternalPath(), 'trace' => debug_backtrace()]);
} catch (NotFoundException $e) {
// pass
}
}
$newShareAttributes->setAttribute(
$formattedAttr['scope'],
$formattedAttr['key'],
@ -2099,6 +2106,11 @@ class ShareAPIController extends OCSController {
if (!$canDownload) {
$attributes = $share->getAttributes() ?? $share->newAttributes();
try {
$this->logger->warning('Setting download permission to false on share', ['share_path' => $share->getNode()->getInternalPath(), 'trace' => debug_backtrace()]);
} catch (NotFoundException $e) {
// pass
}
$attributes->setAttribute('permissions', 'download', false);
$share->setAttributes($attributes);
}