Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/server/src/user/env-var-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ export class EnvVarService {
}
if (projectId) {
await this.auth.checkPermissionOnProject(requestorId, "read_env_var", projectId);
}
if (organizationId) {
await this.auth.checkPermissionOnOrganization(requestorId, "read_env_var", organizationId);
}

Expand All @@ -337,9 +339,7 @@ export class EnvVarService {
}

// 2. then org env vars (if applicable)
if (projectId) {
// !!! Important: Only apply the org env vars if the workspace is part of a project
// This is to prevent leaking org env vars to workspaces randomly started in an organization (safety feature)
if (organizationId) {
const orgEnvVars =
(await ApplicationError.notFoundToUndefined(this.listOrgEnvVars(requestorId, organizationId))) || [];
const withValues: OrgEnvVarWithValue[] = await this.orgDB.getOrgEnvironmentVariableValues(orgEnvVars);
Expand Down
Loading