diff options
Diffstat (limited to 'ocs/routes.php')
-rw-r--r-- | ocs/routes.php | 42 |
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 + ); } |