/**
* Loads a specified role (draft) by $identifier and $status.
*
* @param string $identifier
* @param int $status One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
*
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If role is not found
*
* @return \eZ\Publish\SPI\Persistence\User\Role
*/
public function loadRoleByIdentifier($identifier, $status = Role::STATUS_DEFINED)
{
$data = $this->roleGateway->loadRoleByIdentifier($identifier, $status);
if (empty($data)) {
throw new RoleNotFound($identifier, $status);
}
$role = $this->mapper->mapRole($data);
foreach ($role->policies as $policy) {
$this->limitationConverter->toSPI($policy);
}
return $role;
}