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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ocs
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2016-05-04 16:26:30 +0300
committerBjörn Schießle <schiessle@owncloud.com>2016-05-20 22:15:11 +0300
commitd23df4cba770c9b49bb6c7820cc865a137667922 (patch)
tree7657db0a6251426cc3ecccec8228ee9040aa1fbd /ocs
parent8f87e1104d37063ff561a69348f725a2b907b9f5 (diff)
create re-share by owner and propagate unshare and unshare-from self request
correctly accross share owner and share initiator
Diffstat (limited to 'ocs')
-rw-r--r--ocs/routes.php42
1 files changed, 41 insertions, 1 deletions
diff --git a/ocs/routes.php b/ocs/routes.php
index a7e3488d4a3..1f9fd0037e2 100644
--- a/ocs/routes.php
+++ b/ocs/routes.php
@@ -100,7 +100,25 @@ API::register(
// Server-to-Server Sharing
if (\OC::$server->getAppManager()->isEnabledForUser('files_sharing')) {
$federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application('federatedfilesharing');
- $s2s = new OCA\FederatedFileSharing\RequestHandler($federatedSharingApp->getFederatedShareProvider(), \OC::$server->getDatabaseConnection());
+ $addressHandler = new \OCA\FederatedFileSharing\AddressHandler(
+ \OC::$server->getURLGenerator(),
+ \OC::$server->getL10N('federatedfilesharing')
+ );
+ $notification = new \OCA\FederatedFileSharing\Notifications(
+ $addressHandler,
+ \OC::$server->getHTTPClientService(),
+ new \OCA\FederatedFileSharing\DiscoveryManager(\OC::$server->getMemCacheFactory(), \OC::$server->getHTTPClientService()),
+ \OC::$server->getJobList()
+ );
+ $s2s = new OCA\FederatedFileSharing\RequestHandler(
+ $federatedSharingApp->getFederatedShareProvider(),
+ \OC::$server->getDatabaseConnection(),
+ \OC::$server->getShareManager(),
+ \OC::$server->getRequest(),
+ $notification,
+ $addressHandler,
+ \OC::$server->getUserManager()
+ );
API::register('post',
'/cloud/shares',
array($s2s, 'createShare'),
@@ -109,6 +127,21 @@ if (\OC::$server->getAppManager()->isEnabledForUser('files_sharing')) {
);
API::register('post',
+ '/cloud/shares/{id}/reshare',
+ array($s2s, 'reShare'),
+ 'files_sharing',
+ API::GUEST_AUTH
+ );
+
+ API::register('post',
+ '/cloud/shares/{id}/permissions',
+ array($s2s, 'update'),
+ 'files_sharing',
+ API::GUEST_AUTH
+ );
+
+
+ API::register('post',
'/cloud/shares/{id}/accept',
array($s2s, 'acceptShare'),
'files_sharing',
@@ -128,4 +161,11 @@ if (\OC::$server->getAppManager()->isEnabledForUser('files_sharing')) {
'files_sharing',
API::GUEST_AUTH
);
+
+ API::register('post',
+ '/cloud/shares/{id}/revoke',
+ array($s2s, 'revoke'),
+ 'files_sharing',
+ API::GUEST_AUTH
+ );
}