Implements group update.
This commit is contained in:
parent
dfa2d89ad5
commit
3d786f8df6
1 changed files with 8 additions and 17 deletions
|
@ -175,30 +175,21 @@ class GroupController extends ASCIMGroup {
|
||||||
*
|
*
|
||||||
* @param string $id
|
* @param string $id
|
||||||
*
|
*
|
||||||
* @param bool $active
|
|
||||||
* @param string $displayName
|
* @param string $displayName
|
||||||
* @param array $emails
|
* @param array $members
|
||||||
* @return DataResponse
|
* @return DataResponse
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function update( string $id,
|
public function update( string $id,
|
||||||
bool $active,
|
|
||||||
string $displayName = '',
|
string $displayName = '',
|
||||||
array $emails = []): SCIMJSONResponse {
|
array $members = []): SCIMJSONResponse {
|
||||||
$targetUser = $this->userManager->get($id);
|
$group = $this->groupManager->get($id);
|
||||||
if ($targetUser === null) {
|
foreach ($members as $member) {
|
||||||
return new SCIMErrorResponse(['message' => 'User not found'], 404);
|
$targetUser = $this->userManager->get($member['value']);
|
||||||
|
$group->addUser($targetUser);
|
||||||
|
// todo implement member removal (:
|
||||||
}
|
}
|
||||||
foreach ($emails as $email) {
|
return new SCIMJSONResponse($this->getSCIMGroup($id));
|
||||||
if ($email['primary'] === true) {
|
|
||||||
$targetUser->setEMailAddress($email['value']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($active)) {
|
|
||||||
$targetUser->setEnabled($active);
|
|
||||||
}
|
|
||||||
return new SCIMJSONResponse($this->getSCIMUser($id));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue