only unshare user share if it was shared with the current user

This commit is contained in:
Bjoern Schiessle 2014-06-04 19:45:10 +02:00 committed by Robin Appelman
parent 5bbfdc35d7
commit eec1c4398a
1 changed files with 2 additions and 1 deletions

View File

@ -731,7 +731,8 @@ class Share extends \OC\Share\Constants {
$itemUnshared = false;
foreach ($shares as $share) {
if ((int)$share['share_type'] === \OCP\Share::SHARE_TYPE_USER) {
if ((int)$share['share_type'] === \OCP\Share::SHARE_TYPE_USER &&
$share['share_with'] === \OCP\User::getUser()) {
Helper::delete($share['id']);
$itemUnshared = true;
break;