public function assignSection(ContentInfo $contentInfo, Section $section)
{
$loadedContentInfo = $this->repository->getContentService()->loadContentInfo($contentInfo->id);
$loadedSection = $this->loadSection($section->id);
if ($this->repository->canUser('section', 'assign', $loadedContentInfo, $loadedSection) !== true) {
throw new UnauthorizedException('section', 'assign', array('name' => $loadedSection->name, 'content-name' => $loadedContentInfo->name));
}
$this->repository->beginTransaction();
try {
$this->sectionHandler->assign($loadedSection->id, $loadedContentInfo->id);
$this->repository->commit();
} catch (Exception $e) {
$this->repository->rollback();
throw $e;
}
}