summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2015-11-23 14:06:25 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2015-11-24 10:26:36 +0100
commitaeae73b364048ebf3baf8cf6d692ac4f62467e7e (patch)
tree9a4c955c4c2cdd5e55e3ab73e7718a1309a0296b /lib
parentcb69e6c2011d43b2c19e594e89cbe7c737aaef1b (diff)
downloadnextcloud-server-aeae73b364048ebf3baf8cf6d692ac4f62467e7e.tar.gz
nextcloud-server-aeae73b364048ebf3baf8cf6d692ac4f62467e7e.zip
[Sharing 2.0] Removed unused DI stuff
The share manager etc should not care about filtering stuff. They should return what is asked for them.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share20/manager.php44
1 files changed, 8 insertions, 36 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php
index 57d84967977..e58110b40d2 100644
--- a/lib/private/share20/manager.php
+++ b/lib/private/share20/manager.php
@@ -22,11 +22,7 @@ namespace OC\Share20;
use OCP\IAppConfig;
-use OCP\IUserManager;
-use OCP\IGroupManager;
-use OCP\IUser;
use OCP\ILogger;
-use OCP\Files\Folder;
use OC\Share20\Exception\ShareNotFound;
@@ -40,37 +36,19 @@ class Manager {
*/
private $defaultProvider;
- /** @var IUser */
- private $currentUser;
-
- /** @var IUserManager */
- private $userManager;
-
- /** @var IGroupManager */
- private $groupManager;
-
/** @var ILogger */
private $logger;
/** @var IAppConfig */
private $appConfig;
- /** @var IFolder */
- private $userFolder;
-
- public function __construct(IUser $user,
- IUserManager $userManager,
- IGroupManager $groupManager,
- ILogger $logger,
- IAppConfig $appConfig,
- Folder $userFolder,
- IShareProvider $defaultProvider) {
- $this->currentUser = $user;
- $this->userManager = $userManager;
- $this->groupManager = $groupManager;
+ public function __construct(
+ ILogger $logger,
+ IAppConfig $appConfig,
+ IShareProvider $defaultProvider
+ ) {
$this->logger = $logger;
$this->appConfig = $appConfig;
- $this->userFolder = $userFolder;
// TEMP SOLUTION JUST TO GET STARTED
$this->defaultProvider = $defaultProvider;
@@ -118,7 +96,7 @@ class Manager {
/**
* Delete a share
*
- * @param Share $share
+ * @param IShare $share
* @throws ShareNotFound
* @throws \OC\Share20\Exception\BackendError
*/
@@ -126,7 +104,7 @@ class Manager {
// Just to make sure we have all the info
$share = $this->getShareById($share->getId());
- $formatHookParams = function($share) {
+ $formatHookParams = function(IShare $share) {
// Prepare hook
$shareType = $share->getShareType();
$sharedWith = '';
@@ -203,12 +181,6 @@ class Manager {
$share = $this->defaultProvider->getShareById($id);
- if ($share->getSharedWith() !== $this->currentUser &&
- $share->getSharedBy() !== $this->currentUser &&
- $share->getShareOwner() !== $this->currentUser) {
- throw new ShareNotFound();
- }
-
return $share;
}
@@ -246,7 +218,7 @@ class Manager {
*
* @return Share
*
- * @throws ShareNotFoundException
+ * @throws ShareNotFound
*/
public function getShareByToken($token, $password=null) {
throw new \Exception();