aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-07-08 17:28:18 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-07-08 17:28:18 -0400
commit4feff3456b70d3fa20707f1873869b1ca8e320b8 (patch)
treea5ce489d4c4b3ae1b24d2d17bce04ccf5da96e32 /lib/public
parent244d376a16c1ec6e4fd190aa75adaad3a10af5e1 (diff)
downloadnextcloud-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.php20
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