From 580c1365c6dffc834328683f8a2a9cfdc6498ffd Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Sat, 19 Feb 2022 11:18:03 +0000 Subject: [PATCH] DEBUG --- components/server/src/auth/resource-access.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/server/src/auth/resource-access.ts b/components/server/src/auth/resource-access.ts index 59625822534287..be2cf4a81af27d 100644 --- a/components/server/src/auth/resource-access.ts +++ b/components/server/src/auth/resource-access.ts @@ -7,6 +7,7 @@ import { CommitContext, ContextURL, GitpodToken, Snapshot, Team, TeamMemberInfo, Token, User, UserEnvVar, Workspace, WorkspaceInstance } from "@gitpod/gitpod-protocol"; import { UnauthorizedError } from "../errors"; import { HostContextProvider } from "./host-context-provider"; +import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; declare var resourceInstance: GuardedResource; export type GuardedResourceKind = typeof resourceInstance.kind; @@ -177,6 +178,7 @@ export class OwnerResourceGuard implements ResourceAccessGuard { case "gitpodToken": return resource.subject.user.id === this.userId; case "snapshot": + log.warn(`DEBUG: OwnerResourceGuard ${resource.kind} ${resource.workspace.ownerId === this.userId} ${new Error().stack}`); return resource.workspace.ownerId === this.userId; case "token": return resource.tokenOwnerID === this.userId; @@ -477,6 +479,7 @@ export class RepositoryResourceGuard implements ResourceAccessGuard { // Check if user has at least read access to the repository const workspace = resource.kind === 'snapshot' ? resource.workspace : resource.subject; + log.warn(`DEBUG: RepositoryResourceGuard ${resource.kind} ${workspace.contextURL} ${new Error().stack}`); const contextURL = ContextURL.getNormalizedURL(workspace); if (!contextURL) { throw new Error(`unable to parse ContextURL: ${contextURL}`);