@@ -13,7 +13,7 @@ import {
1313 PrincipalType ,
1414} from '@openops/shared' ;
1515import { StatusCodes } from 'http-status-codes' ;
16- import { assertBenchmarkFeatureEnabled } from './benchmark-feature-guard' ;
16+ import { getBenchmarkFeatureGuard } from './benchmark-feature-guard-factory ' ;
1717import { getBenchmarkStatus , listBenchmarks } from './benchmark-status.service' ;
1818import { createBenchmark } from './create-benchmark.service' ;
1919import { resolveWizardNavigation } from './wizard.service' ;
@@ -23,8 +23,9 @@ export const benchmarkController: FastifyPluginAsyncTypebox = async (app) => {
2323 '/:provider/wizard' ,
2424 WizardStepRequestOptions ,
2525 async ( request , reply ) => {
26- await assertBenchmarkFeatureEnabled (
26+ await getBenchmarkFeatureGuard ( ) . assertBenchmarkFeatureEnabled (
2727 request . principal . projectId ,
28+ request . principal . organization . id ,
2829 request . params . provider ,
2930 ) ;
3031
@@ -44,8 +45,9 @@ export const benchmarkController: FastifyPluginAsyncTypebox = async (app) => {
4445 '/:provider' ,
4546 CreateBenchmarkRequestOptions ,
4647 async ( request , reply ) => {
47- await assertBenchmarkFeatureEnabled (
48+ await getBenchmarkFeatureGuard ( ) . assertBenchmarkFeatureEnabled (
4849 request . principal . projectId ,
50+ request . principal . organization . id ,
4951 request . params . provider ,
5052 ) ;
5153
@@ -59,8 +61,9 @@ export const benchmarkController: FastifyPluginAsyncTypebox = async (app) => {
5961 } ,
6062 ) ;
6163 app . get ( '/' , ListBenchmarksRequestOptions , async ( request , reply ) => {
62- await assertBenchmarkFeatureEnabled (
64+ await getBenchmarkFeatureGuard ( ) . assertBenchmarkFeatureEnabled (
6365 request . principal . projectId ,
66+ request . principal . organization . id ,
6467 request . query . provider ,
6568 ) ;
6669 const items = await listBenchmarks ( {
@@ -74,7 +77,10 @@ export const benchmarkController: FastifyPluginAsyncTypebox = async (app) => {
7477 '/:benchmarkId/status' ,
7578 BenchmarkStatusRequestOptions ,
7679 async ( request , reply ) => {
77- await assertBenchmarkFeatureEnabled ( request . principal . projectId ) ;
80+ await getBenchmarkFeatureGuard ( ) . assertBenchmarkFeatureEnabled (
81+ request . principal . projectId ,
82+ request . principal . organization . id ,
83+ ) ;
7884 const status = await getBenchmarkStatus ( {
7985 benchmarkId : request . params . benchmarkId ,
8086 projectId : request . principal . projectId ,
0 commit comments