auth = $auth; } public function hasPermission($name) { return $this->auth->hasPermission($name); } protected function getUser() { if (null === ($user = $this->auth->getUser())) { throw new AuthenticationException('Authenticated user required'); } return $user; } public function listRoleNames() { return array_map( array($this, 'getNameForRole'), $this->getUser()->getRoles() ); } protected function getNameForRole($role) { return $role->getName(); } }