Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/groupfolders.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-04-02 18:00:55 +0300
committerGitHub <noreply@github.com>2020-04-02 18:00:55 +0300
commit943bd3d719bfe9db88bee14bde197bf1a457b300 (patch)
tree9fee8d833e1a3fe6af22873fbe6e2e5fafaff3c1
parent7f79ae465320e8a1908b33a265cc6048e8a07673 (diff)
parent73827c97e43336468e217d3ba43549818bac44c2 (diff)
Merge pull request #797 from nextcloud/bugfix/noid/return-the-owner-of-the-mountpoint-instead-of-noone
Try to return the owner of the mountpoint before returning no owner
-rw-r--r--lib/Mount/GroupFolderStorage.php9
-rw-r--r--lib/Mount/MountProvider.php3
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/Mount/GroupFolderStorage.php b/lib/Mount/GroupFolderStorage.php
index 9c885101..803146bb 100644
--- a/lib/Mount/GroupFolderStorage.php
+++ b/lib/Mount/GroupFolderStorage.php
@@ -24,6 +24,7 @@ namespace OCA\GroupFolders\Mount;
use OC\Files\Storage\Wrapper\Quota;
use OCP\Files\Cache\ICacheEntry;
+use OCP\IUser;
use OCP\IUserSession;
class GroupFolderStorage extends Quota {
@@ -35,6 +36,8 @@ class GroupFolderStorage extends Quota {
/** @var IUserSession */
private $userSession;
+ /** @var IUser */
+ private $mountOwner;
public $cache;
@@ -43,6 +46,7 @@ class GroupFolderStorage extends Quota {
$this->folderId = $parameters['folder_id'];
$this->rootEntry = $parameters['rootCacheEntry'];
$this->userSession = $parameters['userSession'];
+ $this->mountOwner = $parameters['mountOwner'];
}
public function getFolderId() {
@@ -51,7 +55,10 @@ class GroupFolderStorage extends Quota {
public function getOwner($path) {
$user = $this->userSession->getUser();
- return $user !== null ? $user->getUID() : false;
+ if ($user !== null) {
+ return $user->getUID();
+ }
+ return $this->mountOwner !== null ? $this->mountOwner->getUID() : false;
}
public function instanceOfStorage($class) {
diff --git a/lib/Mount/MountProvider.php b/lib/Mount/MountProvider.php
index cb5adc20..065a4369 100644
--- a/lib/Mount/MountProvider.php
+++ b/lib/Mount/MountProvider.php
@@ -150,7 +150,8 @@ class MountProvider implements IMountProvider {
'quota' => $quota,
'folder_id' => $id,
'rootCacheEntry' => $cacheEntry,
- 'userSession' => $this->userSession
+ 'userSession' => $this->userSession,
+ 'mountOwner' => $user,
]);
$maskedStore = new PermissionsMask([
'storage' => $quotaStorage,