@@ -20,7 +20,8 @@ export class ConfigController {
2020 constructor ( private readonly configService : ConfigService ) { }
2121
2222 @Get ( '/' )
23- @UseGuards ( JwtAuthGuard )
23+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
24+ @Permissions ( 'config:read' , 'config:write' )
2425 @ApiBearerAuth ( 'bearerAuth' )
2526 @ApiOperation ( { summary : 'Get the Kubero settings' } )
2627 @ApiForbiddenResponse ( {
@@ -48,7 +49,8 @@ export class ConfigController {
4849 }
4950
5051 @Get ( '/banner' )
51- @UseGuards ( JwtAuthGuard )
52+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
53+ @Permissions ( 'config:read' )
5254 @ApiBearerAuth ( 'bearerAuth' )
5355 @ApiOperation ( { summary : 'Get the banner informations' } )
5456 @ApiForbiddenResponse ( {
@@ -61,7 +63,8 @@ export class ConfigController {
6163 }
6264
6365 @Get ( '/templates' )
64- @UseGuards ( JwtAuthGuard )
66+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
67+ @Permissions ( 'config:read' )
6568 @ApiBearerAuth ( 'bearerAuth' )
6669 @ApiOperation ( { summary : 'Get the templates settings' } )
6770 @ApiForbiddenResponse ( {
@@ -74,7 +77,8 @@ export class ConfigController {
7477 }
7578
7679 @Get ( '/registry' )
77- @UseGuards ( JwtAuthGuard )
80+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
81+ @Permissions ( 'config:read' )
7882 @ApiBearerAuth ( 'bearerAuth' )
7983 @ApiOperation ( { summary : 'Get the registry settings' } )
8084 @ApiForbiddenResponse ( {
@@ -87,7 +91,8 @@ export class ConfigController {
8791 }
8892
8993 @Get ( '/runpacks' )
90- @UseGuards ( JwtAuthGuard )
94+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
95+ @Permissions ( 'config:read' )
9196 @ApiBearerAuth ( 'bearerAuth' )
9297 @ApiOperation ( { summary : 'List runpacks' } )
9398 @ApiForbiddenResponse ( {
@@ -100,7 +105,8 @@ export class ConfigController {
100105 }
101106
102107 @Delete ( '/runpacks/:id' )
103- @UseGuards ( JwtAuthGuard )
108+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
109+ @Permissions ( 'config:read' , 'config:write' )
104110 @ApiBearerAuth ( 'bearerAuth' )
105111 @ApiOperation ( { summary : 'Delete a runpack' } )
106112 @ApiForbiddenResponse ( {
@@ -114,8 +120,8 @@ export class ConfigController {
114120 }
115121
116122 @Post ( '/runpacks' )
117- @UseGuards ( JwtAuthGuard )
118- @UseGuards ( ReadonlyGuard )
123+ @UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
124+ @Permissions ( 'config:read' , 'config:write' )
119125 @ApiBearerAuth ( 'bearerAuth' )
120126 @ApiOperation ( { summary : 'Add a new runpack' } )
121127 @ApiForbiddenResponse ( {
@@ -146,7 +152,8 @@ export class ConfigController {
146152
147153
148154 @Get ( '/clusterissuer' )
149- @UseGuards ( JwtAuthGuard )
155+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
156+ @Permissions ( 'config:read' )
150157 @ApiBearerAuth ( 'bearerAuth' )
151158 @ApiOperation ( { summary : 'Get the configured cluster issuer' } )
152159 @ApiForbiddenResponse ( {
@@ -166,7 +173,8 @@ export class ConfigController {
166173 }
167174
168175 @Get ( '/podsizes' )
169- @UseGuards ( JwtAuthGuard )
176+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
177+ @Permissions ( 'config:read' )
170178 @ApiBearerAuth ( 'bearerAuth' )
171179 @ApiForbiddenResponse ( {
172180 description : 'Error: Unauthorized' ,
@@ -180,7 +188,7 @@ export class ConfigController {
180188
181189 @Post ( '/podsizes' )
182190 @UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
183- @Permissions ( 'user :read' , 'user :write' )
191+ @Permissions ( 'config :read' , 'config :write' )
184192 @ApiBearerAuth ( 'bearerAuth' )
185193 @ApiForbiddenResponse ( {
186194 description : 'Error: Unauthorized' ,
@@ -244,7 +252,7 @@ export class ConfigController {
244252
245253 @Delete ( '/podsizes/:id' )
246254 @UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
247- @Permissions ( 'user :read' , 'user :write' )
255+ @Permissions ( 'config :read' , 'config :write' )
248256 @ApiBearerAuth ( 'bearerAuth' )
249257 @ApiForbiddenResponse ( {
250258 description : 'Error: Unauthorized' ,
@@ -262,7 +270,7 @@ export class ConfigController {
262270
263271 @Put ( '/podsizes/:id' )
264272 @UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
265- @Permissions ( 'user :read' , 'user :write' )
273+ @Permissions ( 'config :read' , 'config :write' )
266274 @ApiBearerAuth ( 'bearerAuth' )
267275 @ApiForbiddenResponse ( {
268276 description : 'Error: Unauthorized' ,
0 commit comments