return $user;
} /**
* @param string $privilege
* @param string|Zend_Acl_Resource_Interface|null $resource
*
* @throws ApiException\PrivilegeException
*/
public function checkPrivilege($privilege,
$resource = null
) { if (!
$this->
getRole() || !
$this->
getAcl()) { throw new ApiException\
PrivilegeException('Unable to get role or acl'
);
} if (!
$resource) { $calledClass = \
get_called_class();
$calledClass =
explode('\\',
$calledClass);
$resource =
strtolower(end($calledClass));
} if (!
$this->
getAcl()->
has($resource)) { throw new ApiException\
PrivilegeException(sprintf('No resource "%s" found',
$resource));
}