only determine is sharing is disabled for a user once
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e9c9754cec
commit
8c2b76bef0
|
@ -84,6 +84,7 @@ class MountProvider implements IMountProvider {
|
|||
$mounts = [];
|
||||
$view = new View('/' . $user->getUID() . '/files');
|
||||
$ownerViews = [];
|
||||
$sharingDisabledForUser = $this->shareManager->sharingDisabledForUser($user->getUID());
|
||||
foreach ($superShares as $share) {
|
||||
try {
|
||||
/** @var \OCP\Share\IShare $parentShare */
|
||||
|
@ -101,7 +102,8 @@ class MountProvider implements IMountProvider {
|
|||
'superShare' => $parentShare,
|
||||
// children/component of the superShare
|
||||
'groupedShares' => $share[1],
|
||||
'ownerView' => $ownerViews[$owner]
|
||||
'ownerView' => $ownerViews[$owner],
|
||||
'sharingDisabledForUser' => $sharingDisabledForUser
|
||||
],
|
||||
$storageFactory,
|
||||
$view
|
||||
|
|
|
@ -78,6 +78,9 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
|
|||
|
||||
private $options;
|
||||
|
||||
/** @var boolean */
|
||||
private $sharingDisabledForUser;
|
||||
|
||||
public function __construct($arguments) {
|
||||
$this->ownerView = $arguments['ownerView'];
|
||||
$this->logger = \OC::$server->getLogger();
|
||||
|
@ -86,6 +89,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
|
|||
$this->groupedShares = $arguments['groupedShares'];
|
||||
|
||||
$this->user = $arguments['user'];
|
||||
if (isset($arguments['sharingDisabledForUser'])) {
|
||||
$this->sharingDisabledForUser = $arguments['sharingDisabledForUser'];
|
||||
} else {
|
||||
$this->sharingDisabledForUser = false;
|
||||
}
|
||||
|
||||
parent::__construct([
|
||||
'storage' => null,
|
||||
|
@ -192,7 +200,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
|
|||
$permissions |= \OCP\Constants::PERMISSION_DELETE;
|
||||
}
|
||||
|
||||
if (\OCP\Util::isSharingDisabledForUser()) {
|
||||
if ($this->sharingDisabledForUser) {
|
||||
$permissions &= ~\OCP\Constants::PERMISSION_SHARE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue