$calledClass =
explode('\\',
$calledClass);
$resource =
strtolower(end($calledClass));
} if (!
$this->
getAcl()->
has($resource)) { throw new ApiException\
PrivilegeException(sprintf('No resource "%s" found',
$resource));
} $role =
$this->
getRole();
if (!
$this->
getAcl()->
isAllowed($role,
$resource,
$privilege)) { throw new ApiException\
PrivilegeException(sprintf('Role "%s" is not allowed to "%s" on resource "%s"', \
is_string($role) ?
$role :
$role->
getRoleId(),
$privilege, \
is_string($resource) ?
$resource :
$resource->
getResourceId()));
} } /**
* @param string $privilege
* @param string|null $resource
*
* @return bool
*/
public function hasPrivilege($privilege,
$resource = null
) {