diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-11 09:46:25 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-14 18:34:01 +0200 |
commit | 432e7c93c6dad564abbaec1e3d374f73653d7ba6 (patch) | |
tree | a62391960c90a66357ba56e42fc480d357b22dbd /apps/provisioning_api/appinfo/routes.php | |
parent | 0fdeefe47c82b18eb6adf1bd66ec2471b4d76c25 (diff) | |
download | nextcloud-server-432e7c93c6dad564abbaec1e3d374f73653d7ba6.tar.gz nextcloud-server-432e7c93c6dad564abbaec1e3d374f73653d7ba6.zip |
Move Groups over to OCSController
* Take advantage of the AppFramework
* Fix tests
Diffstat (limited to 'apps/provisioning_api/appinfo/routes.php')
-rw-r--r-- | apps/provisioning_api/appinfo/routes.php | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/apps/provisioning_api/appinfo/routes.php b/apps/provisioning_api/appinfo/routes.php index 907e16ebf3c..dbc0321efb2 100644 --- a/apps/provisioning_api/appinfo/routes.php +++ b/apps/provisioning_api/appinfo/routes.php @@ -26,13 +26,22 @@ * */ -namespace OCA\Provisioning_API\AppInfo; - use OCA\Provisioning_API\Apps; -use OCA\Provisioning_API\Groups; use OCA\Provisioning_API\Users; use OCP\API; +$app = new \OCA\Provisioning_API\AppInfo\Application(); +$app->registerRoutes($this, [ + 'ocs' => [ + // Groups + ['root' => '/cloud', 'name' => 'Groups#getGroups', 'url' => '/groups', 'verb' => 'GET'], + ['root' => '/cloud', 'name' => 'Groups#getGroup', 'url' => '/groups/{groupId}', 'verb' => 'GET'], + ['root' => '/cloud', 'name' => 'Groups#addGroup', 'url' => '/groups', 'verb' => 'POST'], + ['root' => '/cloud', 'name' => 'Groups#deleteGroup', 'url' => '/groups/{groupId}', 'verb' => 'DELETE'], + ['root' => '/cloud', 'name' => 'Groups#getSubAdminsOfGroup', 'url' => '/groups/{groupId}/subadmins', 'verb' => 'GET'], + ], +]); + // Users $users = new Users( \OC::$server->getUserManager(), @@ -55,18 +64,6 @@ API::register('post', '/cloud/users/{userid}/subadmins', [$users, 'addSubAdmin'] API::register('delete', '/cloud/users/{userid}/subadmins', [$users, 'removeSubAdmin'], 'provisioning_api', API::ADMIN_AUTH); API::register('get', '/cloud/users/{userid}/subadmins', [$users, 'getUserSubAdminGroups'], 'provisioning_api', API::ADMIN_AUTH); -// Groups -$groups = new Groups( - \OC::$server->getGroupManager(), - \OC::$server->getUserSession(), - \OC::$server->getRequest() -); -API::register('get', '/cloud/groups', [$groups, 'getGroups'], 'provisioning_api', API::SUBADMIN_AUTH); -API::register('post', '/cloud/groups', [$groups, 'addGroup'], 'provisioning_api', API::SUBADMIN_AUTH); -API::register('get', '/cloud/groups/{groupid}', [$groups, 'getGroup'], 'provisioning_api', API::SUBADMIN_AUTH); -API::register('delete', '/cloud/groups/{groupid}', [$groups, 'deleteGroup'], 'provisioning_api', API::ADMIN_AUTH); -API::register('get', '/cloud/groups/{groupid}/subadmins', [$groups, 'getSubAdminsOfGroup'], 'provisioning_api', API::ADMIN_AUTH); - // Apps $apps = new Apps( \OC::$server->getAppManager(), |