@@ -40,190 +40,190 @@ |
||
| 40 | 40 | |
| 41 | 41 | class GroupsController extends OCSController { |
| 42 | 42 | |
| 43 | - /** @var IGroupManager */ |
|
| 44 | - private $groupManager; |
|
| 45 | - |
|
| 46 | - /** @var IUserSession */ |
|
| 47 | - private $userSession; |
|
| 48 | - |
|
| 49 | - /** @var ILogger */ |
|
| 50 | - private $logger; |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @param string $appName |
|
| 54 | - * @param IRequest $request |
|
| 55 | - * @param IGroupManager $groupManager |
|
| 56 | - * @param IUserSession $userSession |
|
| 57 | - * @param ILogger $logger |
|
| 58 | - */ |
|
| 59 | - public function __construct( |
|
| 60 | - string $appName, |
|
| 61 | - IRequest $request, |
|
| 62 | - IGroupManager $groupManager, |
|
| 63 | - IUserSession $userSession, |
|
| 64 | - ILogger $logger) { |
|
| 65 | - parent::__construct($appName, $request); |
|
| 66 | - |
|
| 67 | - $this->groupManager = $groupManager; |
|
| 68 | - $this->userSession = $userSession; |
|
| 69 | - $this->logger = $logger; |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - /** |
|
| 73 | - * returns a list of groups |
|
| 74 | - * |
|
| 75 | - * @NoAdminRequired |
|
| 76 | - * |
|
| 77 | - * @param string $search |
|
| 78 | - * @param int $limit |
|
| 79 | - * @param int $offset |
|
| 80 | - * @return DataResponse |
|
| 81 | - */ |
|
| 82 | - public function getGroups(string $search = '', $limit = null, $offset = null): DataResponse { |
|
| 83 | - if ($limit !== null) { |
|
| 84 | - $limit = (int)$limit; |
|
| 85 | - } |
|
| 86 | - if ($offset !== null) { |
|
| 87 | - $offset = (int)$offset; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - $groups = $this->groupManager->search($search, $limit, $offset); |
|
| 91 | - $groups = array_map(function($group) { |
|
| 92 | - /** @var IGroup $group */ |
|
| 93 | - return $group->getGID(); |
|
| 94 | - }, $groups); |
|
| 95 | - |
|
| 96 | - return new DataResponse(['groups' => $groups]); |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - /** |
|
| 100 | - * returns a list of groups |
|
| 101 | - * |
|
| 102 | - * @NoAdminRequired |
|
| 103 | - * |
|
| 104 | - * @param string $search |
|
| 105 | - * @param int $limit |
|
| 106 | - * @param int $offset |
|
| 107 | - * @return DataResponse |
|
| 108 | - */ |
|
| 109 | - public function getGroupsDetails(string $search = '', $limit = null, $offset = null): DataResponse { |
|
| 110 | - if ($limit !== null) { |
|
| 111 | - $limit = (int)$limit; |
|
| 112 | - } |
|
| 113 | - if ($offset !== null) { |
|
| 114 | - $offset = (int)$offset; |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - $groups = $this->groupManager->search($search, $limit, $offset); |
|
| 118 | - $groups = array_map(function($group) { |
|
| 119 | - /** @var IGroup $group */ |
|
| 120 | - return ['id' => $group->getGID(), 'displayname' => $group->getDisplayName()]; |
|
| 121 | - }, $groups); |
|
| 122 | - |
|
| 123 | - return new DataResponse(['groups' => $groups]); |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * returns an array of users in the group specified |
|
| 128 | - * |
|
| 129 | - * @NoAdminRequired |
|
| 130 | - * |
|
| 131 | - * @param string $groupId |
|
| 132 | - * @return DataResponse |
|
| 133 | - * @throws OCSException |
|
| 134 | - */ |
|
| 135 | - public function getGroup(string $groupId): DataResponse { |
|
| 136 | - $user = $this->userSession->getUser(); |
|
| 137 | - |
|
| 138 | - // Check the group exists |
|
| 139 | - if(!$this->groupManager->groupExists($groupId)) { |
|
| 140 | - throw new OCSException('The requested group could not be found', \OCP\API::RESPOND_NOT_FOUND); |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - $isSubadminOfGroup = false; |
|
| 144 | - $group = $this->groupManager->get($groupId); |
|
| 145 | - if ($group !== null) { |
|
| 146 | - $isSubadminOfGroup =$this->groupManager->getSubAdmin()->isSubAdminofGroup($user, $group); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - // Check subadmin has access to this group |
|
| 150 | - if($this->groupManager->isAdmin($user->getUID()) |
|
| 151 | - || $isSubadminOfGroup) { |
|
| 152 | - $users = $this->groupManager->get($groupId)->getUsers(); |
|
| 153 | - $users = array_map(function($user) { |
|
| 154 | - /** @var IUser $user */ |
|
| 155 | - return $user->getUID(); |
|
| 156 | - }, $users); |
|
| 157 | - $users = array_values($users); |
|
| 158 | - return new DataResponse(['users' => $users]); |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - throw new OCSException('User does not have access to specified group', \OCP\API::RESPOND_UNAUTHORISED); |
|
| 162 | - } |
|
| 163 | - |
|
| 164 | - /** |
|
| 165 | - * creates a new group |
|
| 166 | - * |
|
| 167 | - * @PasswordConfirmationRequired |
|
| 168 | - * |
|
| 169 | - * @param string $groupid |
|
| 170 | - * @return DataResponse |
|
| 171 | - * @throws OCSException |
|
| 172 | - */ |
|
| 173 | - public function addGroup(string $groupid): DataResponse { |
|
| 174 | - // Validate name |
|
| 175 | - if(empty($groupid)) { |
|
| 176 | - $this->logger->error('Group name not supplied', ['app' => 'provisioning_api']); |
|
| 177 | - throw new OCSException('Invalid group name', 101); |
|
| 178 | - } |
|
| 179 | - // Check if it exists |
|
| 180 | - if($this->groupManager->groupExists($groupid)){ |
|
| 181 | - throw new OCSException('', 102); |
|
| 182 | - } |
|
| 183 | - $this->groupManager->createGroup($groupid); |
|
| 184 | - return new DataResponse(); |
|
| 185 | - } |
|
| 186 | - |
|
| 187 | - /** |
|
| 188 | - * @PasswordConfirmationRequired |
|
| 189 | - * |
|
| 190 | - * @param string $groupId |
|
| 191 | - * @return DataResponse |
|
| 192 | - * @throws OCSException |
|
| 193 | - */ |
|
| 194 | - public function deleteGroup(string $groupId): DataResponse { |
|
| 195 | - // Check it exists |
|
| 196 | - if(!$this->groupManager->groupExists($groupId)){ |
|
| 197 | - throw new OCSException('', 101); |
|
| 198 | - } else if($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){ |
|
| 199 | - // Cannot delete admin group |
|
| 200 | - throw new OCSException('', 102); |
|
| 201 | - } |
|
| 202 | - |
|
| 203 | - return new DataResponse(); |
|
| 204 | - } |
|
| 205 | - |
|
| 206 | - /** |
|
| 207 | - * @param string $groupId |
|
| 208 | - * @return DataResponse |
|
| 209 | - * @throws OCSException |
|
| 210 | - */ |
|
| 211 | - public function getSubAdminsOfGroup(string $groupId): DataResponse { |
|
| 212 | - // Check group exists |
|
| 213 | - $targetGroup = $this->groupManager->get($groupId); |
|
| 214 | - if($targetGroup === null) { |
|
| 215 | - throw new OCSException('Group does not exist', 101); |
|
| 216 | - } |
|
| 217 | - |
|
| 218 | - /** @var IUser[] $subadmins */ |
|
| 219 | - $subadmins = $this->groupManager->getSubAdmin()->getGroupsSubAdmins($targetGroup); |
|
| 220 | - // New class returns IUser[] so convert back |
|
| 221 | - $uids = []; |
|
| 222 | - foreach ($subadmins as $user) { |
|
| 223 | - $uids[] = $user->getUID(); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - return new DataResponse($uids); |
|
| 227 | - } |
|
| 43 | + /** @var IGroupManager */ |
|
| 44 | + private $groupManager; |
|
| 45 | + |
|
| 46 | + /** @var IUserSession */ |
|
| 47 | + private $userSession; |
|
| 48 | + |
|
| 49 | + /** @var ILogger */ |
|
| 50 | + private $logger; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @param string $appName |
|
| 54 | + * @param IRequest $request |
|
| 55 | + * @param IGroupManager $groupManager |
|
| 56 | + * @param IUserSession $userSession |
|
| 57 | + * @param ILogger $logger |
|
| 58 | + */ |
|
| 59 | + public function __construct( |
|
| 60 | + string $appName, |
|
| 61 | + IRequest $request, |
|
| 62 | + IGroupManager $groupManager, |
|
| 63 | + IUserSession $userSession, |
|
| 64 | + ILogger $logger) { |
|
| 65 | + parent::__construct($appName, $request); |
|
| 66 | + |
|
| 67 | + $this->groupManager = $groupManager; |
|
| 68 | + $this->userSession = $userSession; |
|
| 69 | + $this->logger = $logger; |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * returns a list of groups |
|
| 74 | + * |
|
| 75 | + * @NoAdminRequired |
|
| 76 | + * |
|
| 77 | + * @param string $search |
|
| 78 | + * @param int $limit |
|
| 79 | + * @param int $offset |
|
| 80 | + * @return DataResponse |
|
| 81 | + */ |
|
| 82 | + public function getGroups(string $search = '', $limit = null, $offset = null): DataResponse { |
|
| 83 | + if ($limit !== null) { |
|
| 84 | + $limit = (int)$limit; |
|
| 85 | + } |
|
| 86 | + if ($offset !== null) { |
|
| 87 | + $offset = (int)$offset; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + $groups = $this->groupManager->search($search, $limit, $offset); |
|
| 91 | + $groups = array_map(function($group) { |
|
| 92 | + /** @var IGroup $group */ |
|
| 93 | + return $group->getGID(); |
|
| 94 | + }, $groups); |
|
| 95 | + |
|
| 96 | + return new DataResponse(['groups' => $groups]); |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + /** |
|
| 100 | + * returns a list of groups |
|
| 101 | + * |
|
| 102 | + * @NoAdminRequired |
|
| 103 | + * |
|
| 104 | + * @param string $search |
|
| 105 | + * @param int $limit |
|
| 106 | + * @param int $offset |
|
| 107 | + * @return DataResponse |
|
| 108 | + */ |
|
| 109 | + public function getGroupsDetails(string $search = '', $limit = null, $offset = null): DataResponse { |
|
| 110 | + if ($limit !== null) { |
|
| 111 | + $limit = (int)$limit; |
|
| 112 | + } |
|
| 113 | + if ($offset !== null) { |
|
| 114 | + $offset = (int)$offset; |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + $groups = $this->groupManager->search($search, $limit, $offset); |
|
| 118 | + $groups = array_map(function($group) { |
|
| 119 | + /** @var IGroup $group */ |
|
| 120 | + return ['id' => $group->getGID(), 'displayname' => $group->getDisplayName()]; |
|
| 121 | + }, $groups); |
|
| 122 | + |
|
| 123 | + return new DataResponse(['groups' => $groups]); |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * returns an array of users in the group specified |
|
| 128 | + * |
|
| 129 | + * @NoAdminRequired |
|
| 130 | + * |
|
| 131 | + * @param string $groupId |
|
| 132 | + * @return DataResponse |
|
| 133 | + * @throws OCSException |
|
| 134 | + */ |
|
| 135 | + public function getGroup(string $groupId): DataResponse { |
|
| 136 | + $user = $this->userSession->getUser(); |
|
| 137 | + |
|
| 138 | + // Check the group exists |
|
| 139 | + if(!$this->groupManager->groupExists($groupId)) { |
|
| 140 | + throw new OCSException('The requested group could not be found', \OCP\API::RESPOND_NOT_FOUND); |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + $isSubadminOfGroup = false; |
|
| 144 | + $group = $this->groupManager->get($groupId); |
|
| 145 | + if ($group !== null) { |
|
| 146 | + $isSubadminOfGroup =$this->groupManager->getSubAdmin()->isSubAdminofGroup($user, $group); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + // Check subadmin has access to this group |
|
| 150 | + if($this->groupManager->isAdmin($user->getUID()) |
|
| 151 | + || $isSubadminOfGroup) { |
|
| 152 | + $users = $this->groupManager->get($groupId)->getUsers(); |
|
| 153 | + $users = array_map(function($user) { |
|
| 154 | + /** @var IUser $user */ |
|
| 155 | + return $user->getUID(); |
|
| 156 | + }, $users); |
|
| 157 | + $users = array_values($users); |
|
| 158 | + return new DataResponse(['users' => $users]); |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + throw new OCSException('User does not have access to specified group', \OCP\API::RESPOND_UNAUTHORISED); |
|
| 162 | + } |
|
| 163 | + |
|
| 164 | + /** |
|
| 165 | + * creates a new group |
|
| 166 | + * |
|
| 167 | + * @PasswordConfirmationRequired |
|
| 168 | + * |
|
| 169 | + * @param string $groupid |
|
| 170 | + * @return DataResponse |
|
| 171 | + * @throws OCSException |
|
| 172 | + */ |
|
| 173 | + public function addGroup(string $groupid): DataResponse { |
|
| 174 | + // Validate name |
|
| 175 | + if(empty($groupid)) { |
|
| 176 | + $this->logger->error('Group name not supplied', ['app' => 'provisioning_api']); |
|
| 177 | + throw new OCSException('Invalid group name', 101); |
|
| 178 | + } |
|
| 179 | + // Check if it exists |
|
| 180 | + if($this->groupManager->groupExists($groupid)){ |
|
| 181 | + throw new OCSException('', 102); |
|
| 182 | + } |
|
| 183 | + $this->groupManager->createGroup($groupid); |
|
| 184 | + return new DataResponse(); |
|
| 185 | + } |
|
| 186 | + |
|
| 187 | + /** |
|
| 188 | + * @PasswordConfirmationRequired |
|
| 189 | + * |
|
| 190 | + * @param string $groupId |
|
| 191 | + * @return DataResponse |
|
| 192 | + * @throws OCSException |
|
| 193 | + */ |
|
| 194 | + public function deleteGroup(string $groupId): DataResponse { |
|
| 195 | + // Check it exists |
|
| 196 | + if(!$this->groupManager->groupExists($groupId)){ |
|
| 197 | + throw new OCSException('', 101); |
|
| 198 | + } else if($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){ |
|
| 199 | + // Cannot delete admin group |
|
| 200 | + throw new OCSException('', 102); |
|
| 201 | + } |
|
| 202 | + |
|
| 203 | + return new DataResponse(); |
|
| 204 | + } |
|
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * @param string $groupId |
|
| 208 | + * @return DataResponse |
|
| 209 | + * @throws OCSException |
|
| 210 | + */ |
|
| 211 | + public function getSubAdminsOfGroup(string $groupId): DataResponse { |
|
| 212 | + // Check group exists |
|
| 213 | + $targetGroup = $this->groupManager->get($groupId); |
|
| 214 | + if($targetGroup === null) { |
|
| 215 | + throw new OCSException('Group does not exist', 101); |
|
| 216 | + } |
|
| 217 | + |
|
| 218 | + /** @var IUser[] $subadmins */ |
|
| 219 | + $subadmins = $this->groupManager->getSubAdmin()->getGroupsSubAdmins($targetGroup); |
|
| 220 | + // New class returns IUser[] so convert back |
|
| 221 | + $uids = []; |
|
| 222 | + foreach ($subadmins as $user) { |
|
| 223 | + $uids[] = $user->getUID(); |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + return new DataResponse($uids); |
|
| 227 | + } |
|
| 228 | 228 | |
| 229 | 229 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | /** |
| 4 | 4 | * @copyright Copyright (c) 2016, ownCloud, Inc. |
| 5 | 5 | * |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function getGroups(string $search = '', $limit = null, $offset = null): DataResponse { |
| 83 | 83 | if ($limit !== null) { |
| 84 | - $limit = (int)$limit; |
|
| 84 | + $limit = (int) $limit; |
|
| 85 | 85 | } |
| 86 | 86 | if ($offset !== null) { |
| 87 | - $offset = (int)$offset; |
|
| 87 | + $offset = (int) $offset; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $groups = $this->groupManager->search($search, $limit, $offset); |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function getGroupsDetails(string $search = '', $limit = null, $offset = null): DataResponse { |
| 110 | 110 | if ($limit !== null) { |
| 111 | - $limit = (int)$limit; |
|
| 111 | + $limit = (int) $limit; |
|
| 112 | 112 | } |
| 113 | 113 | if ($offset !== null) { |
| 114 | - $offset = (int)$offset; |
|
| 114 | + $offset = (int) $offset; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $groups = $this->groupManager->search($search, $limit, $offset); |
@@ -136,21 +136,21 @@ discard block |
||
| 136 | 136 | $user = $this->userSession->getUser(); |
| 137 | 137 | |
| 138 | 138 | // Check the group exists |
| 139 | - if(!$this->groupManager->groupExists($groupId)) { |
|
| 139 | + if (!$this->groupManager->groupExists($groupId)) { |
|
| 140 | 140 | throw new OCSException('The requested group could not be found', \OCP\API::RESPOND_NOT_FOUND); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $isSubadminOfGroup = false; |
| 144 | 144 | $group = $this->groupManager->get($groupId); |
| 145 | 145 | if ($group !== null) { |
| 146 | - $isSubadminOfGroup =$this->groupManager->getSubAdmin()->isSubAdminofGroup($user, $group); |
|
| 146 | + $isSubadminOfGroup = $this->groupManager->getSubAdmin()->isSubAdminofGroup($user, $group); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // Check subadmin has access to this group |
| 150 | - if($this->groupManager->isAdmin($user->getUID()) |
|
| 150 | + if ($this->groupManager->isAdmin($user->getUID()) |
|
| 151 | 151 | || $isSubadminOfGroup) { |
| 152 | 152 | $users = $this->groupManager->get($groupId)->getUsers(); |
| 153 | - $users = array_map(function($user) { |
|
| 153 | + $users = array_map(function($user) { |
|
| 154 | 154 | /** @var IUser $user */ |
| 155 | 155 | return $user->getUID(); |
| 156 | 156 | }, $users); |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function addGroup(string $groupid): DataResponse { |
| 174 | 174 | // Validate name |
| 175 | - if(empty($groupid)) { |
|
| 175 | + if (empty($groupid)) { |
|
| 176 | 176 | $this->logger->error('Group name not supplied', ['app' => 'provisioning_api']); |
| 177 | 177 | throw new OCSException('Invalid group name', 101); |
| 178 | 178 | } |
| 179 | 179 | // Check if it exists |
| 180 | - if($this->groupManager->groupExists($groupid)){ |
|
| 180 | + if ($this->groupManager->groupExists($groupid)) { |
|
| 181 | 181 | throw new OCSException('', 102); |
| 182 | 182 | } |
| 183 | 183 | $this->groupManager->createGroup($groupid); |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function deleteGroup(string $groupId): DataResponse { |
| 195 | 195 | // Check it exists |
| 196 | - if(!$this->groupManager->groupExists($groupId)){ |
|
| 196 | + if (!$this->groupManager->groupExists($groupId)) { |
|
| 197 | 197 | throw new OCSException('', 101); |
| 198 | - } else if($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){ |
|
| 198 | + } else if ($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()) { |
|
| 199 | 199 | // Cannot delete admin group |
| 200 | 200 | throw new OCSException('', 102); |
| 201 | 201 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | public function getSubAdminsOfGroup(string $groupId): DataResponse { |
| 212 | 212 | // Check group exists |
| 213 | 213 | $targetGroup = $this->groupManager->get($groupId); |
| 214 | - if($targetGroup === null) { |
|
| 214 | + if ($targetGroup === null) { |
|
| 215 | 215 | throw new OCSException('Group does not exist', 101); |
| 216 | 216 | } |
| 217 | 217 | |
@@ -25,45 +25,45 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | return [ |
| 28 | - 'ocs' => [ |
|
| 29 | - // Apps |
|
| 30 | - ['root' => '/cloud', 'name' => 'Apps#getApps', 'url' => '/apps', 'verb' => 'GET'], |
|
| 31 | - ['root' => '/cloud', 'name' => 'Apps#getAppInfo', 'url' => '/apps/{app}', 'verb' => 'GET'], |
|
| 32 | - ['root' => '/cloud', 'name' => 'Apps#enable', 'url' => '/apps/{app}', 'verb' => 'POST'], |
|
| 33 | - ['root' => '/cloud', 'name' => 'Apps#disable', 'url' => '/apps/{app}', 'verb' => 'DELETE'], |
|
| 28 | + 'ocs' => [ |
|
| 29 | + // Apps |
|
| 30 | + ['root' => '/cloud', 'name' => 'Apps#getApps', 'url' => '/apps', 'verb' => 'GET'], |
|
| 31 | + ['root' => '/cloud', 'name' => 'Apps#getAppInfo', 'url' => '/apps/{app}', 'verb' => 'GET'], |
|
| 32 | + ['root' => '/cloud', 'name' => 'Apps#enable', 'url' => '/apps/{app}', 'verb' => 'POST'], |
|
| 33 | + ['root' => '/cloud', 'name' => 'Apps#disable', 'url' => '/apps/{app}', 'verb' => 'DELETE'], |
|
| 34 | 34 | |
| 35 | - // Groups |
|
| 36 | - ['root' => '/cloud', 'name' => 'Groups#getGroups', 'url' => '/groups', 'verb' => 'GET'], |
|
| 37 | - ['root' => '/cloud', 'name' => 'Groups#getGroupsDetails', 'url' => '/groups/details', 'verb' => 'GET'], |
|
| 38 | - ['root' => '/cloud', 'name' => 'Groups#getGroup', 'url' => '/groups/{groupId}', 'verb' => 'GET'], |
|
| 39 | - ['root' => '/cloud', 'name' => 'Groups#addGroup', 'url' => '/groups', 'verb' => 'POST'], |
|
| 40 | - ['root' => '/cloud', 'name' => 'Groups#deleteGroup', 'url' => '/groups/{groupId}', 'verb' => 'DELETE'], |
|
| 41 | - ['root' => '/cloud', 'name' => 'Groups#getSubAdminsOfGroup', 'url' => '/groups/{groupId}/subadmins', 'verb' => 'GET'], |
|
| 35 | + // Groups |
|
| 36 | + ['root' => '/cloud', 'name' => 'Groups#getGroups', 'url' => '/groups', 'verb' => 'GET'], |
|
| 37 | + ['root' => '/cloud', 'name' => 'Groups#getGroupsDetails', 'url' => '/groups/details', 'verb' => 'GET'], |
|
| 38 | + ['root' => '/cloud', 'name' => 'Groups#getGroup', 'url' => '/groups/{groupId}', 'verb' => 'GET'], |
|
| 39 | + ['root' => '/cloud', 'name' => 'Groups#addGroup', 'url' => '/groups', 'verb' => 'POST'], |
|
| 40 | + ['root' => '/cloud', 'name' => 'Groups#deleteGroup', 'url' => '/groups/{groupId}', 'verb' => 'DELETE'], |
|
| 41 | + ['root' => '/cloud', 'name' => 'Groups#getSubAdminsOfGroup', 'url' => '/groups/{groupId}/subadmins', 'verb' => 'GET'], |
|
| 42 | 42 | |
| 43 | - // Users |
|
| 44 | - ['root' => '/cloud', 'name' => 'Users#getUsers', 'url' => '/users', 'verb' => 'GET'], |
|
| 45 | - ['root' => '/cloud', 'name' => 'Users#getUsersDetails', 'url' => '/users/details', 'verb' => 'GET'], |
|
| 46 | - ['root' => '/cloud', 'name' => 'Users#addUser', 'url' => '/users', 'verb' => 'POST'], |
|
| 47 | - ['root' => '/cloud', 'name' => 'Users#getUser', 'url' => '/users/{userId}', 'verb' => 'GET'], |
|
| 48 | - ['root' => '/cloud', 'name' => 'Users#getCurrentUser', 'url' => '/user', 'verb' => 'GET'], |
|
| 49 | - ['root' => '/cloud', 'name' => 'Users#getEditableFields', 'url' => '/user/fields', 'verb' => 'GET'], |
|
| 50 | - ['root' => '/cloud', 'name' => 'Users#editUser', 'url' => '/users/{userId}', 'verb' => 'PUT'], |
|
| 51 | - ['root' => '/cloud', 'name' => 'Users#deleteUser', 'url' => '/users/{userId}', 'verb' => 'DELETE'], |
|
| 52 | - ['root' => '/cloud', 'name' => 'Users#enableUser', 'url' => '/users/{userId}/enable', 'verb' => 'PUT'], |
|
| 53 | - ['root' => '/cloud', 'name' => 'Users#disableUser', 'url' => '/users/{userId}/disable', 'verb' => 'PUT'], |
|
| 54 | - ['root' => '/cloud', 'name' => 'Users#getUsersGroups', 'url' => '/users/{userId}/groups', 'verb' => 'GET'], |
|
| 55 | - ['root' => '/cloud', 'name' => 'Users#addToGroup', 'url' => '/users/{userId}/groups', 'verb' => 'POST'], |
|
| 56 | - ['root' => '/cloud', 'name' => 'Users#removeFromGroup', 'url' => '/users/{userId}/groups', 'verb' => 'DELETE'], |
|
| 57 | - ['root' => '/cloud', 'name' => 'Users#getUserSubAdminGroups', 'url' => '/users/{userId}/subadmins', 'verb' => 'GET'], |
|
| 58 | - ['root' => '/cloud', 'name' => 'Users#addSubAdmin', 'url' => '/users/{userId}/subadmins', 'verb' => 'POST'], |
|
| 59 | - ['root' => '/cloud', 'name' => 'Users#removeSubAdmin', 'url' => '/users/{userId}/subadmins', 'verb' => 'DELETE'], |
|
| 60 | - ['root' => '/cloud', 'name' => 'Users#resendWelcomeMessage', 'url' => '/users/{userId}/welcome', 'verb' => 'POST'], |
|
| 43 | + // Users |
|
| 44 | + ['root' => '/cloud', 'name' => 'Users#getUsers', 'url' => '/users', 'verb' => 'GET'], |
|
| 45 | + ['root' => '/cloud', 'name' => 'Users#getUsersDetails', 'url' => '/users/details', 'verb' => 'GET'], |
|
| 46 | + ['root' => '/cloud', 'name' => 'Users#addUser', 'url' => '/users', 'verb' => 'POST'], |
|
| 47 | + ['root' => '/cloud', 'name' => 'Users#getUser', 'url' => '/users/{userId}', 'verb' => 'GET'], |
|
| 48 | + ['root' => '/cloud', 'name' => 'Users#getCurrentUser', 'url' => '/user', 'verb' => 'GET'], |
|
| 49 | + ['root' => '/cloud', 'name' => 'Users#getEditableFields', 'url' => '/user/fields', 'verb' => 'GET'], |
|
| 50 | + ['root' => '/cloud', 'name' => 'Users#editUser', 'url' => '/users/{userId}', 'verb' => 'PUT'], |
|
| 51 | + ['root' => '/cloud', 'name' => 'Users#deleteUser', 'url' => '/users/{userId}', 'verb' => 'DELETE'], |
|
| 52 | + ['root' => '/cloud', 'name' => 'Users#enableUser', 'url' => '/users/{userId}/enable', 'verb' => 'PUT'], |
|
| 53 | + ['root' => '/cloud', 'name' => 'Users#disableUser', 'url' => '/users/{userId}/disable', 'verb' => 'PUT'], |
|
| 54 | + ['root' => '/cloud', 'name' => 'Users#getUsersGroups', 'url' => '/users/{userId}/groups', 'verb' => 'GET'], |
|
| 55 | + ['root' => '/cloud', 'name' => 'Users#addToGroup', 'url' => '/users/{userId}/groups', 'verb' => 'POST'], |
|
| 56 | + ['root' => '/cloud', 'name' => 'Users#removeFromGroup', 'url' => '/users/{userId}/groups', 'verb' => 'DELETE'], |
|
| 57 | + ['root' => '/cloud', 'name' => 'Users#getUserSubAdminGroups', 'url' => '/users/{userId}/subadmins', 'verb' => 'GET'], |
|
| 58 | + ['root' => '/cloud', 'name' => 'Users#addSubAdmin', 'url' => '/users/{userId}/subadmins', 'verb' => 'POST'], |
|
| 59 | + ['root' => '/cloud', 'name' => 'Users#removeSubAdmin', 'url' => '/users/{userId}/subadmins', 'verb' => 'DELETE'], |
|
| 60 | + ['root' => '/cloud', 'name' => 'Users#resendWelcomeMessage', 'url' => '/users/{userId}/welcome', 'verb' => 'POST'], |
|
| 61 | 61 | |
| 62 | - // Config |
|
| 63 | - ['name' => 'AppConfig#getApps', 'url' => '/api/v1/config/apps', 'verb' => 'GET'], |
|
| 64 | - ['name' => 'AppConfig#getKeys', 'url' => '/api/v1/config/apps/{app}', 'verb' => 'GET'], |
|
| 65 | - ['name' => 'AppConfig#getValue', 'url' => '/api/v1/config/apps/{app}/{key}', 'verb' => 'GET'], |
|
| 66 | - ['name' => 'AppConfig#setValue', 'url' => '/api/v1/config/apps/{app}/{key}', 'verb' => 'POST'], |
|
| 67 | - ['name' => 'AppConfig#deleteKey', 'url' => '/api/v1/config/apps/{app}/{key}', 'verb' => 'DELETE'], |
|
| 68 | - ], |
|
| 62 | + // Config |
|
| 63 | + ['name' => 'AppConfig#getApps', 'url' => '/api/v1/config/apps', 'verb' => 'GET'], |
|
| 64 | + ['name' => 'AppConfig#getKeys', 'url' => '/api/v1/config/apps/{app}', 'verb' => 'GET'], |
|
| 65 | + ['name' => 'AppConfig#getValue', 'url' => '/api/v1/config/apps/{app}/{key}', 'verb' => 'GET'], |
|
| 66 | + ['name' => 'AppConfig#setValue', 'url' => '/api/v1/config/apps/{app}/{key}', 'verb' => 'POST'], |
|
| 67 | + ['name' => 'AppConfig#deleteKey', 'url' => '/api/v1/config/apps/{app}/{key}', 'verb' => 'DELETE'], |
|
| 68 | + ], |
|
| 69 | 69 | ]; |