@@ -42,7 +42,6 @@ import {
42
42
ImageBuildLogInfo ,
43
43
ImageConfigFile ,
44
44
NamedWorkspaceFeatureFlag ,
45
- OrgEnvVarWithValue ,
46
45
Permission ,
47
46
Project ,
48
47
RefType ,
@@ -129,7 +128,7 @@ import { TokenProvider } from "../user/token-provider";
129
128
import { UserAuthentication } from "../user/user-authentication" ;
130
129
import { ImageSourceProvider } from "./image-source-provider" ;
131
130
import { WorkspaceClassesConfig } from "./workspace-classes" ;
132
- import { SYSTEM_USER , SYSTEM_USER_ID , Authorizer } from "../authorization/authorizer" ;
131
+ import { SYSTEM_USER , SYSTEM_USER_ID } from "../authorization/authorizer" ;
133
132
import { EnvVarService , ResolvedEnvVars } from "../user/env-var-service" ;
134
133
import { RedlockAbortSignal } from "redlock" ;
135
134
import { ConfigProvider } from "./config-provider" ;
@@ -240,7 +239,6 @@ export class WorkspaceStarter {
240
239
@inject ( EnvVarService ) private readonly envVarService : EnvVarService ,
241
240
@inject ( OrganizationService ) private readonly orgService : OrganizationService ,
242
241
@inject ( ProjectsService ) private readonly projectService : ProjectsService ,
243
- @inject ( Authorizer ) private readonly auth : Authorizer ,
244
242
) { }
245
243
246
244
public async startWorkspace (
@@ -2047,11 +2045,9 @@ export class WorkspaceStarter {
2047
2045
2048
2046
// if the image resolution is for an organization, we also include the organization's set up env vars
2049
2047
if ( organizationId ) {
2050
- await this . auth . checkPermissionOnOrganization ( user . id , "read_env_var" , organizationId ) ;
2051
- const orgEnvVars = await this . orgDB . getOrgEnvironmentVariables ( organizationId ) ;
2052
- const orgEnvVarValues : OrgEnvVarWithValue [ ] = await this . orgDB . getOrgEnvironmentVariableValues ( orgEnvVars ) ;
2048
+ const envVars = await this . envVarService . listOrgEnvVarsWithValues ( user . id , organizationId ) ;
2053
2049
2054
- const additionalAuth = await this . getAdditionalImageAuth ( { workspace : orgEnvVarValues } ) ;
2050
+ const additionalAuth = await this . getAdditionalImageAuth ( { workspace : envVars } ) ;
2055
2051
additionalAuth . forEach ( ( val , key ) => auth . getAdditionalMap ( ) . set ( key , val ) ) ;
2056
2052
}
2057
2053
0 commit comments