/** * @param Route $route * @param array $scopes * @return bool */ private function handleScope(Route $route, $scopes = []) { if (!empty($scopes)) { if ($this->token->hasScope($scopes, $route->getService())) { return true; } $this->unauthorized('Invalid Scope', 'Permission Denied! Service [ ' . $route->getService() . ' ] requires scopes [' . implode(',', $route->getScopes()) . '] to access this resource.'); } return true; }