| @@ 195-209 (lines=15) @@ | ||
| 192 | * |
|
| 193 | * @return \eZ\Publish\API\Repository\Values\Content\Section[] |
|
| 194 | */ |
|
| 195 | public function loadSections() |
|
| 196 | { |
|
| 197 | if ($this->repository->hasAccess('section', 'view') !== true) { |
|
| 198 | throw new UnauthorizedException('section', 'view'); |
|
| 199 | } |
|
| 200 | ||
| 201 | $spiSections = $this->sectionHandler->loadAll(); |
|
| 202 | ||
| 203 | $sections = array(); |
|
| 204 | foreach ($spiSections as $spiSection) { |
|
| 205 | $sections[] = $this->buildDomainSectionObject($spiSection); |
|
| 206 | } |
|
| 207 | ||
| 208 | return $sections; |
|
| 209 | } |
|
| 210 | ||
| 211 | /** |
|
| 212 | * Loads a Section from its identifier ($sectionIdentifier). |
|
| @@ 799-813 (lines=15) @@ | ||
| 796 | * |
|
| 797 | * @return \eZ\Publish\API\Repository\Values\User\Role[] |
|
| 798 | */ |
|
| 799 | public function loadRoles() |
|
| 800 | { |
|
| 801 | if ($this->repository->hasAccess('role', 'read') !== true) { |
|
| 802 | throw new UnauthorizedException('role', 'read'); |
|
| 803 | } |
|
| 804 | ||
| 805 | $spiRoles = $this->userHandler->loadRoles(); |
|
| 806 | ||
| 807 | $roles = array(); |
|
| 808 | foreach ($spiRoles as $spiRole) { |
|
| 809 | $roles[] = $this->roleDomainMapper->buildDomainRoleObject($spiRole); |
|
| 810 | } |
|
| 811 | ||
| 812 | return $roles; |
|
| 813 | } |
|
| 814 | ||
| 815 | /** |
|
| 816 | * Deletes the given role. |
|