From 460fdf9eafe2db629637ba481f2b135ed21560b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Wed, 17 Jan 2024 13:34:00 +0100 Subject: [PATCH] fix(auth): add server daily email backup permission for all versions of core user role (#1028) --- ...5493201352-enable-email-backups-for-all.ts | 22 +++++++++++++++++++ ...5493490376-enable-email-backups-for-all.ts | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 packages/auth/migrations/mysql/1705493201352-enable-email-backups-for-all.ts create mode 100644 packages/auth/migrations/sqlite/1705493490376-enable-email-backups-for-all.ts diff --git a/packages/auth/migrations/mysql/1705493201352-enable-email-backups-for-all.ts b/packages/auth/migrations/mysql/1705493201352-enable-email-backups-for-all.ts new file mode 100644 index 000000000..16e91eb3b --- /dev/null +++ b/packages/auth/migrations/mysql/1705493201352-enable-email-backups-for-all.ts @@ -0,0 +1,22 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class EnableEmailBackupsForAll1705493201352 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + // Core User v1 Permissions + await queryRunner.query( + 'INSERT INTO `role_permissions` (role_uuid, permission_uuid) VALUES \ + ("bde42e26-628c-44e6-9d76-21b08954b0bf", "eb0575a2-6e26-49e3-9501-f2e75d7dbda3") \ + ', + ) + // Core User v2 Permissions + await queryRunner.query( + 'INSERT INTO `role_permissions` (role_uuid, permission_uuid) VALUES \ + ("23bf88ca-bee1-4a4c-adf0-b7a48749eea7", "eb0575a2-6e26-49e3-9501-f2e75d7dbda3") \ + ', + ) + } + + public async down(): Promise { + return + } +} diff --git a/packages/auth/migrations/sqlite/1705493490376-enable-email-backups-for-all.ts b/packages/auth/migrations/sqlite/1705493490376-enable-email-backups-for-all.ts new file mode 100644 index 000000000..3264e6ed1 --- /dev/null +++ b/packages/auth/migrations/sqlite/1705493490376-enable-email-backups-for-all.ts @@ -0,0 +1,22 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class EnableEmailBackupsForAll1705493490376 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + // Core User v1 Permissions + await queryRunner.query( + 'INSERT INTO `role_permissions` (role_uuid, permission_uuid) VALUES \ + ("bde42e26-628c-44e6-9d76-21b08954b0bf", "eb0575a2-6e26-49e3-9501-f2e75d7dbda3") \ + ', + ) + // Core User v2 Permissions + await queryRunner.query( + 'INSERT INTO `role_permissions` (role_uuid, permission_uuid) VALUES \ + ("23bf88ca-bee1-4a4c-adf0-b7a48749eea7", "eb0575a2-6e26-49e3-9501-f2e75d7dbda3") \ + ', + ) + } + + public async down(): Promise { + return + } +}