@@ -2250,7 +2250,10 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
2250
2250
return undefined ;
2251
2251
}
2252
2252
2253
- await this . guardAccess ( { kind : "prebuild" , subject : pbws , workspace, teamMembers : undefined } , "get" ) ;
2253
+ // TODO(gpl) Ideally, we should not need to query the project-team hierarchy here, but decide on a per-prebuild basis.
2254
+ // For that we need to fix Prebuild-access semantics, which is out-of-scope for now.
2255
+ const teamMembers = await this . getTeamMembersByProject ( workspace . projectId ) ;
2256
+ await this . guardAccess ( { kind : "prebuild" , subject : pbws , workspace, teamMembers } , "get" ) ;
2254
2257
const result : PrebuildWithStatus = { info, status : pbws . state } ;
2255
2258
if ( pbws . error ) {
2256
2259
result . error = pbws . error ;
@@ -2273,7 +2276,10 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
2273
2276
return undefined ;
2274
2277
}
2275
2278
2276
- await this . guardAccess ( { kind : "prebuild" , subject : pbws , workspace, teamMembers : undefined } , "get" ) ;
2279
+ // TODO(gpl) Ideally, we should not need to query the project-team hierarchy here, but decide on a per-prebuild basis.
2280
+ // For that we need to fix Prebuild-access semantics, which is out-of-scope for now.
2281
+ const teamMembers = await this . getTeamMembersByProject ( workspace . projectId ) ;
2282
+ await this . guardAccess ( { kind : "prebuild" , subject : pbws , workspace, teamMembers } , "get" ) ;
2277
2283
return pbws ;
2278
2284
}
2279
2285
0 commit comments