Merge pull request #3979 from owncloud/permissions-hook

Add update permissions hook to sharing
This commit is contained in:
Jörn Friedrich Dreyer 2013-07-08 09:32:10 -07:00
commit 15907f6aee
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