diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-07-09 05:40:16 -0700 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-07-09 05:40:16 -0700 |
commit | cc0965b9bca53d4c6e31aed76c8eedea1d65a5c1 (patch) | |
tree | 6dfb123faab33080c4e5af4bfe215481237935b3 | |
parent | 5513e30752896ce7a96188b244d9960bc3867bde (diff) | |
parent | 4feff3456b70d3fa20707f1873869b1ca8e320b8 (diff) | |
download | nextcloud-server-cc0965b9bca53d4c6e31aed76c8eedea1d65a5c1.tar.gz nextcloud-server-cc0965b9bca53d4c6e31aed76c8eedea1d65a5c1.zip |
Merge pull request #3980 from owncloud/try-permissions-hook-again
Add update permissions hook to sharing
-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 |