summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-10-06 18:09:12 +0200
committerRobin Appelman <robin@icewind.nl>2015-10-06 18:09:12 +0200
commit59cf817308c65a8bfcb876308a38c18917dfe59e (patch)
tree4518ac6508e9adf1285cdae4802b4722d64ed080 /lib
parent3413b766311c1936097d260544a5181695cd7822 (diff)
parent17756ebf5bb7c2bdf9e949f3fc517c39ed284600 (diff)
downloadnextcloud-server-59cf817308c65a8bfcb876308a38c18917dfe59e.tar.gz
nextcloud-server-59cf817308c65a8bfcb876308a38c18917dfe59e.zip
Merge pull request #19511 from owncloud/etag-share-permissions-update
Mark shares as dirty when changing permissions
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share/share.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 49eeb3829c4..932586b5c27 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -1099,6 +1099,7 @@ class Share extends Constants {
'uidOwner' => \OC_User::getUser(),
'permissions' => $permissions,
'path' => $item['path'],
+ 'share' => $item
));
}
// Check if permissions were removed
@@ -1109,16 +1110,18 @@ class Share extends Constants {
Helper::delete($item['id'], true, null, null, true);
} else {
$ids = array();
+ $items = [];
$parents = array($item['id']);
while (!empty($parents)) {
$parents = "'".implode("','", $parents)."'";
- $query = \OC_DB::prepare('SELECT `id`, `permissions` FROM `*PREFIX*share`'
+ $query = \OC_DB::prepare('SELECT `id`, `permissions`, `item_type` FROM `*PREFIX*share`'
.' WHERE `parent` IN ('.$parents.')');
$result = $query->execute();
// Reset parents array, only go through loop again if
// items are found that need permissions removed
$parents = array();
while ($item = $result->fetchRow()) {
+ $items[] = $item;
// Check if permissions need to be removed
if ($item['permissions'] & ~$permissions) {
// Add to list of items that need permissions removed
@@ -1140,8 +1143,13 @@ class Share extends Constants {
.' WHERE `id` IN ('.$ids.')');
$query->execute(array($permissions));
}
+
+ foreach ($items as $item) {
+ \OC_Hook::emit('OCP\Share', 'post_update_permissions', ['share' => $item]);
+ }
}
}
+
return true;
}
$message = 'Setting permissions for %s failed, because the item was not found';