Skip to content
Snippets Groups Projects
Commit 15907f6a authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

Merge pull request #3979 from owncloud/permissions-hook

Add update permissions hook to sharing
parents 02d2e41e 5c2a0325
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment