@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -253,7 +253,36 @@ export class Migrate implements MigrationInterface {
253
253
  }
254
254
  }
255
255
 
256
- const adminAccessRoutes = [88, 1, 3];
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