public function updateUserGroup($groupPath, Request $request)
{
$userGroupLocation = $this->locationService->loadLocation($this->extractLocationIdFromPath($groupPath));
$userGroup = $this->userService->loadUserGroup($userGroupLocation->contentId);
$updateStruct = $this->inputDispatcher->parse(new Message(array('Content-Type' => $request->headers->get('Content-Type'), 'Url' => $request->getPathInfo()), $request->getContent()));
if ($updateStruct->sectionId !== null) {
$section = $this->sectionService->loadSection($updateStruct->sectionId);
$this->sectionService->assignSection($userGroup->getVersionInfo()->getContentInfo(), $section);
}
$updatedGroup = $this->userService->updateUserGroup($userGroup, $updateStruct->userGroupUpdateStruct);
$contentType = $this->contentTypeService->loadContentType($updatedGroup->getVersionInfo()->getContentInfo()->contentTypeId);
return new Values\RestUserGroup($updatedGroup, $contentType, $updatedGroup->getVersionInfo()->getContentInfo(), $userGroupLocation, $this->contentService->loadRelations($updatedGroup->getVersionInfo()));
}