public function hasRole($id, $role) { if (!($user = $this->getUser($id))) { return false; } return in_array($role, $user['roles']); }