]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add update permissions hook to sharing
authorMichael Gapczynski <mtgap@owncloud.com>
Mon, 8 Jul 2013 15:40:10 +0000 (11:40 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 8 Jul 2013 15:40:10 +0000 (11:40 -0400)
lib/public/share.php

index 7ae0ffe0bfdf0fc24e9eac902e3c28086cfae588..d852230afaf4233d30863a0f5f73df4577bab4fc 100644 (file)
@@ -657,6 +657,15 @@ 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,
+                       ));
                        // Check if permissions were removed
                        if ($item['permissions'] & ~$permissions) {
                                // If share permission is removed all reshares must be deleted