From: Michael Gapczynski Date: Mon, 8 Jul 2013 21:28:18 +0000 (-0400) Subject: Only emit permissions hook for files and and include path X-Git-Tag: v6.0.0alpha2~487^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4feff3456b70d3fa20707f1873869b1ca8e320b8;p=nextcloud-server.git Only emit permissions hook for files and and include path --- diff --git a/lib/public/share.php b/lib/public/share.php index d852230afaf..596a729a47d 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -657,15 +657,17 @@ class Share { } $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = ? WHERE `id` = ?'); $query->execute(array($permissions, $item['id'])); - \OC_Hook::emit('OCP\Share', 'post_update_permissions', array( - 'itemType' => $itemType, - 'itemSource' => $itemSource, - 'itemTarget' => $itemTarget, - 'shareType' => $shareType, - 'shareWith' => $shareWith, - 'uidOwner' => \OC_User::getUser(), - 'permissions' => $permissions, - )); + if ($itemType === 'file' || $itemType === 'folder') { + \OC_Hook::emit('OCP\Share', 'post_update_permissions', array( + 'itemType' => $itemType, + 'itemSource' => $itemSource, + 'shareType' => $shareType, + 'shareWith' => $shareWith, + 'uidOwner' => \OC_User::getUser(), + 'permissions' => $permissions, + 'path' => $item['path'], + )); + } // Check if permissions were removed if ($item['permissions'] & ~$permissions) { // If share permission is removed all reshares must be deleted