Skip to content

Commit

Permalink
Make sure the super share also has a valid type
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 31, 2019
1 parent c34c38c commit 9fdda51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/files_sharing/lib/MountProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ public function getMountsForUser(IUser $user, IStorageFactory $storageFactory) {
/** @var \OCP\Share\IShare $parentShare */
$parentShare = $share[0];

if (($parentShare->getShareType() === IShare::TYPE_GROUP ||
$parentShare->getShareType() === IShare::TYPE_USERGROUP ||
$parentShare->getShareType() === IShare::TYPE_USER) && $parentShare->getStatus() !== IShare::STATUS_ACCEPTED) {
if ($parentShare->getStatus() !== IShare::STATUS_ACCEPTED &&
($parentShare->getShareType() === IShare::TYPE_GROUP ||
$parentShare->getShareType() === IShare::TYPE_USERGROUP ||
$parentShare->getShareType() === IShare::TYPE_USER)) {
continue;
}

Expand Down Expand Up @@ -192,6 +193,7 @@ private function buildSuperShares(array $allShares, \OCP\IUser $user) {
$superShare->setId($shares[0]->getId())
->setShareOwner($shares[0]->getShareOwner())
->setNodeId($shares[0]->getNodeId())
->setShareType($shares[0]->getShareType())
->setTarget($shares[0]->getTarget());

// use most permissive permissions
Expand Down

0 comments on commit 9fdda51

Please sign in to comment.