aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2025-08-04 08:13:41 +0200
committerMarcel Klehr <mklehr@gmx.net>2025-08-04 08:23:45 +0200
commitc04d4e8c689f29c294f7baead8f09f72d2a96db1 (patch)
treec0f8b459d09f5851e0849317ca8f07af77cdd124
parent286c10c8b98b5642fbe0fbad766cc02e8d194dbb (diff)
downloadnextcloud-server-debug/download-permision.tar.gz
nextcloud-server-debug/download-permision.zip
debug(ShareAPIController): Add log statements for manipulation of download permissiondebug/download-permision
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index d11834e1e07..b3c9f1af292 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -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);
}