@@ -20,7 +20,8 @@ export class ConfigController {
20
20
constructor ( private readonly configService : ConfigService ) { }
21
21
22
22
@Get ( '/' )
23
- @UseGuards ( JwtAuthGuard )
23
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
24
+ @Permissions ( 'config:read' , 'config:write' )
24
25
@ApiBearerAuth ( 'bearerAuth' )
25
26
@ApiOperation ( { summary : 'Get the Kubero settings' } )
26
27
@ApiForbiddenResponse ( {
@@ -48,7 +49,8 @@ export class ConfigController {
48
49
}
49
50
50
51
@Get ( '/banner' )
51
- @UseGuards ( JwtAuthGuard )
52
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
53
+ @Permissions ( 'config:read' )
52
54
@ApiBearerAuth ( 'bearerAuth' )
53
55
@ApiOperation ( { summary : 'Get the banner informations' } )
54
56
@ApiForbiddenResponse ( {
@@ -61,7 +63,8 @@ export class ConfigController {
61
63
}
62
64
63
65
@Get ( '/templates' )
64
- @UseGuards ( JwtAuthGuard )
66
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
67
+ @Permissions ( 'config:read' )
65
68
@ApiBearerAuth ( 'bearerAuth' )
66
69
@ApiOperation ( { summary : 'Get the templates settings' } )
67
70
@ApiForbiddenResponse ( {
@@ -74,7 +77,8 @@ export class ConfigController {
74
77
}
75
78
76
79
@Get ( '/registry' )
77
- @UseGuards ( JwtAuthGuard )
80
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
81
+ @Permissions ( 'config:read' )
78
82
@ApiBearerAuth ( 'bearerAuth' )
79
83
@ApiOperation ( { summary : 'Get the registry settings' } )
80
84
@ApiForbiddenResponse ( {
@@ -87,7 +91,8 @@ export class ConfigController {
87
91
}
88
92
89
93
@Get ( '/runpacks' )
90
- @UseGuards ( JwtAuthGuard )
94
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
95
+ @Permissions ( 'config:read' )
91
96
@ApiBearerAuth ( 'bearerAuth' )
92
97
@ApiOperation ( { summary : 'List runpacks' } )
93
98
@ApiForbiddenResponse ( {
@@ -100,7 +105,8 @@ export class ConfigController {
100
105
}
101
106
102
107
@Delete ( '/runpacks/:id' )
103
- @UseGuards ( JwtAuthGuard )
108
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
109
+ @Permissions ( 'config:read' , 'config:write' )
104
110
@ApiBearerAuth ( 'bearerAuth' )
105
111
@ApiOperation ( { summary : 'Delete a runpack' } )
106
112
@ApiForbiddenResponse ( {
@@ -114,8 +120,8 @@ export class ConfigController {
114
120
}
115
121
116
122
@Post ( '/runpacks' )
117
- @UseGuards ( JwtAuthGuard )
118
- @UseGuards ( ReadonlyGuard )
123
+ @UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
124
+ @Permissions ( 'config:read' , 'config:write' )
119
125
@ApiBearerAuth ( 'bearerAuth' )
120
126
@ApiOperation ( { summary : 'Add a new runpack' } )
121
127
@ApiForbiddenResponse ( {
@@ -146,7 +152,8 @@ export class ConfigController {
146
152
147
153
148
154
@Get ( '/clusterissuer' )
149
- @UseGuards ( JwtAuthGuard )
155
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
156
+ @Permissions ( 'config:read' )
150
157
@ApiBearerAuth ( 'bearerAuth' )
151
158
@ApiOperation ( { summary : 'Get the configured cluster issuer' } )
152
159
@ApiForbiddenResponse ( {
@@ -166,7 +173,8 @@ export class ConfigController {
166
173
}
167
174
168
175
@Get ( '/podsizes' )
169
- @UseGuards ( JwtAuthGuard )
176
+ @UseGuards ( JwtAuthGuard , PermissionsGuard )
177
+ @Permissions ( 'config:read' )
170
178
@ApiBearerAuth ( 'bearerAuth' )
171
179
@ApiForbiddenResponse ( {
172
180
description : 'Error: Unauthorized' ,
@@ -180,7 +188,7 @@ export class ConfigController {
180
188
181
189
@Post ( '/podsizes' )
182
190
@UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
183
- @Permissions ( 'user :read' , 'user :write' )
191
+ @Permissions ( 'config :read' , 'config :write' )
184
192
@ApiBearerAuth ( 'bearerAuth' )
185
193
@ApiForbiddenResponse ( {
186
194
description : 'Error: Unauthorized' ,
@@ -244,7 +252,7 @@ export class ConfigController {
244
252
245
253
@Delete ( '/podsizes/:id' )
246
254
@UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
247
- @Permissions ( 'user :read' , 'user :write' )
255
+ @Permissions ( 'config :read' , 'config :write' )
248
256
@ApiBearerAuth ( 'bearerAuth' )
249
257
@ApiForbiddenResponse ( {
250
258
description : 'Error: Unauthorized' ,
@@ -262,7 +270,7 @@ export class ConfigController {
262
270
263
271
@Put ( '/podsizes/:id' )
264
272
@UseGuards ( JwtAuthGuard , PermissionsGuard , ReadonlyGuard )
265
- @Permissions ( 'user :read' , 'user :write' )
273
+ @Permissions ( 'config :read' , 'config :write' )
266
274
@ApiBearerAuth ( 'bearerAuth' )
267
275
@ApiForbiddenResponse ( {
268
276
description : 'Error: Unauthorized' ,
0 commit comments