Limit and offset
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
68ae4394f7
commit
f4e84e1727
|
@ -187,10 +187,12 @@ class GroupsController extends OCSController {
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*
|
*
|
||||||
* @param string $groupId
|
* @param string $groupId
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @return DataResponse
|
* @return DataResponse
|
||||||
* @throws OCSException
|
* @throws OCSException
|
||||||
*/
|
*/
|
||||||
public function getGroupUsersDetails(string $groupId): DataResponse {
|
public function getGroupUsersDetails(string $groupId, $limit = null, $offset = 0): DataResponse {
|
||||||
$user = $this->userSession->getUser();
|
$user = $this->userSession->getUser();
|
||||||
|
|
||||||
// Check the group exists
|
// Check the group exists
|
||||||
|
@ -208,6 +210,8 @@ class GroupsController extends OCSController {
|
||||||
if($this->groupManager->isAdmin($user->getUID())
|
if($this->groupManager->isAdmin($user->getUID())
|
||||||
|| $isSubadminOfGroup) {
|
|| $isSubadminOfGroup) {
|
||||||
$users = $this->groupManager->get($groupId)->getUsers();
|
$users = $this->groupManager->get($groupId)->getUsers();
|
||||||
|
// Extract required number
|
||||||
|
$users = array_slice($users, $offset, $limit);
|
||||||
$users = array_map(function($user) {
|
$users = array_map(function($user) {
|
||||||
/** @var IUser $user */
|
/** @var IUser $user */
|
||||||
return $this->userController->getUserData($user->getUID());
|
return $this->userController->getUserData($user->getUID());
|
||||||
|
|
Loading…
Reference in New Issue