[Pkg-owncloud-commits] [owncloud] 59/107: [Sharing] Properly check if a group already has access
David Prévot
taffit at moszumanska.debian.org
Thu Dec 17 19:40:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 3bdca9beb45b8e9e1b999ebc01b924925a00efed
Author: Roeland Jago Douma <rullzer at owncloud.com>
Date: Fri Dec 4 12:10:08 2015 +0100
[Sharing] Properly check if a group already has access
The old code check was to liberal resulting in wrong matches if a user
with the same name as the group already had access.
Fixes 20892
---
lib/private/share/share.php | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 95e5e7e..04acd3c 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -745,10 +745,8 @@ class Share extends Constants {
// The check for each user in the group is done inside the put() function
if ($checkExists = self::getItems($itemType, $itemSource, self::SHARE_TYPE_GROUP, $shareWith,
null, self::FORMAT_NONE, null, 1, true, true)) {
- // Only allow the same share to occur again if it is the same
- // owner and is not a group share, this use case is for increasing
- // permissions for a specific user
- if ($checkExists['uid_owner'] != $uidOwner || $checkExists['share_type'] == $shareType) {
+
+ if ($checkExists['share_with'] === $shareWith && $checkExists['share_type'] === \OCP\Share::SHARE_TYPE_GROUP) {
$message = 'Sharing %s failed, because this item is already shared with %s';
$message_t = $l->t('Sharing %s failed, because this item is already shared with %s', array($itemSourceName, $shareWith));
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::DEBUG);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list