Merge pull request #3980 from owncloud/try-permissions-hook-again
Add update permissions hook to sharing
This commit is contained in:
commit
cc0965b9bc
1 changed files with 11 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue