summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/lib/FederatedShareProvider.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2016-05-11 20:48:27 +0200
committerBjörn Schießle <schiessle@owncloud.com>2016-05-20 21:15:15 +0200
commit7b25839bd51b3b6cd920209c254f014c03437113 (patch)
tree2e9885bdb068d56ff7bb9fde344c4da0cc95e2d3 /apps/federatedfilesharing/lib/FederatedShareProvider.php
parent81e3787f9cb4936f186b25e0dccb07b4e6dcce83 (diff)
downloadnextcloud-server-7b25839bd51b3b6cd920209c254f014c03437113.tar.gz
nextcloud-server-7b25839bd51b3b6cd920209c254f014c03437113.zip
use share initiator as fall back to access the file
in case of federated re-shares the owner can be a remote user. Therefore we can't always use to owner to access the local file
Diffstat (limited to 'apps/federatedfilesharing/lib/FederatedShareProvider.php')
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 590c61559bf..762b015d280 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -23,13 +23,12 @@
namespace OCA\FederatedFileSharing;
-use OC\Files\View;
use OC\Share20\Share;
use OCP\Files\IRootFolder;
-use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IL10N;
use OCP\ILogger;
+use OCP\IUserManager;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
use OC\Share20\Exception\InvalidShare;
@@ -74,6 +73,9 @@ class FederatedShareProvider implements IShareProvider {
/** @var string */
private $externalShareTable = 'share_external';
+ /** @var IUserManager */
+ private $userManager;
+
/**
* DefaultShareProvider constructor.
*
@@ -85,6 +87,7 @@ class FederatedShareProvider implements IShareProvider {
* @param ILogger $logger
* @param IRootFolder $rootFolder
* @param IConfig $config
+ * @param IUserManager $userManager
*/
public function __construct(
IDBConnection $connection,
@@ -94,7 +97,8 @@ class FederatedShareProvider implements IShareProvider {
IL10N $l10n,
ILogger $logger,
IRootFolder $rootFolder,
- IConfig $config
+ IConfig $config,
+ IUserManager $userManager
) {
$this->dbConnection = $connection;
$this->addressHandler = $addressHandler;
@@ -104,6 +108,7 @@ class FederatedShareProvider implements IShareProvider {
$this->logger = $logger;
$this->rootFolder = $rootFolder;
$this->config = $config;
+ $this->userManager = $userManager;
}
/**
@@ -699,7 +704,7 @@ class FederatedShareProvider implements IShareProvider {
*/
private function createShare($data) {
- $share = new Share($this->rootFolder);
+ $share = new Share($this->rootFolder, $this->userManager);
$share->setId((int)$data['id'])
->setShareType((int)$data['share_type'])
->setPermissions((int)$data['permissions'])