]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only emit permissions hook for files and and include path
authorMichael Gapczynski <mtgap@owncloud.com>
Mon, 8 Jul 2013 21:28:18 +0000 (17:28 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 8 Jul 2013 21:28:18 +0000 (17:28 -0400)
lib/public/share.php

index d852230afaf4233d30863a0f5f73df4577bab4fc..596a729a47d06a3c02357c99584235014ae38c33 100644 (file)
@@ -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