diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-07-08 17:28:18 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-07-08 17:28:18 -0400 |
commit | 4feff3456b70d3fa20707f1873869b1ca8e320b8 (patch) | |
tree | a5ce489d4c4b3ae1b24d2d17bce04ccf5da96e32 /lib/public | |
parent | 244d376a16c1ec6e4fd190aa75adaad3a10af5e1 (diff) | |
download | nextcloud-server-4feff3456b70d3fa20707f1873869b1ca8e320b8.tar.gz nextcloud-server-4feff3456b70d3fa20707f1873869b1ca8e320b8.zip |
Only emit permissions hook for files and and include path
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share.php | 20 |
1 files changed, 11 insertions, 9 deletions
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 |