@hedhog/admin 0.0.52 → 0.0.53
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/migrations/migrate-20.ts +30 -1
package/package.json
CHANGED
@@ -253,7 +253,36 @@ export class Migrate implements MigrationInterface {
|
|
253
253
|
}
|
254
254
|
}
|
255
255
|
|
256
|
-
const
|
256
|
+
const routesGetRole3 = await queryRunner.manager
|
257
|
+
.createQueryBuilder()
|
258
|
+
.select('id')
|
259
|
+
.from('routes', 'r')
|
260
|
+
.where('r.url IN (:...urls)', {
|
261
|
+
urls: [
|
262
|
+
'/settings/groups',
|
263
|
+
'/settings/groups/:slug',
|
264
|
+
'/auth/verify',
|
265
|
+
'/menus/system',
|
266
|
+
],
|
267
|
+
})
|
268
|
+
.where('r.method = :method', { method: 'GET' })
|
269
|
+
.execute();
|
270
|
+
|
271
|
+
const routesPutRole3 = await queryRunner.manager
|
272
|
+
.createQueryBuilder()
|
273
|
+
.select('id')
|
274
|
+
.from('routes', 'r')
|
275
|
+
.where('r.url IN (:...urls)', {
|
276
|
+
urls: ['/settings/:slug'],
|
277
|
+
})
|
278
|
+
.where('r.method = :method', { method: 'PUT' })
|
279
|
+
.execute();
|
280
|
+
|
281
|
+
const adminAccessRoutes = [];
|
282
|
+
|
283
|
+
for (const route of [...routesGetRole3, ...routesPutRole3]) {
|
284
|
+
adminAccessRoutes.push(route.id);
|
285
|
+
}
|
257
286
|
|
258
287
|
for (const routeId of adminAccessRoutes) {
|
259
288
|
await queryRunner.manager
|