Add update permissions hook to sharing

This commit is contained in:
Michael Gapczynski 2013-07-08 11:40:10 -04:00
parent 02d2e41e04
commit 5c2a0325ba
1 changed files with 9 additions and 0 deletions

View 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