mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-29 17:38:07 +00:00
* add column app_create to group_permissions table * add app create column to group permission entity * backfill app_create permission as true for admin group * add app delete permissions to group permissions * update group permissions entity for app delete * add ability to set group level permission for app creation * refactor and fix app clone and imports * fix created by user on homepage * fix spinner on import * update seeds service to set group level permission * fix rollback query * fix imported/cloned app timestamps * honor logged in user permissions at UI * remove console log * fix data query id being replaced on import * replace data query id within app versions on import
28 lines
913 B
TypeScript
28 lines
913 B
TypeScript
import { EntityManager, In, MigrationInterface, QueryRunner } from "typeorm";
|
|
import { GroupPermission } from "../src/entities/group_permission.entity";
|
|
|
|
export class BackfillAppCreatePermissionsAsTruthyForAdminGroup1634729050892
|
|
implements MigrationInterface
|
|
{
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
const entityManager = queryRunner.manager;
|
|
const GroupPermissionRepostory =
|
|
entityManager.getRepository(GroupPermission);
|
|
|
|
await GroupPermissionRepostory.update(
|
|
{ group: "admin" },
|
|
{ appCreate: true, appDelete: true }
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
const entityManager = queryRunner.manager;
|
|
const GroupPermissionRepostory =
|
|
entityManager.getRepository(GroupPermission);
|
|
|
|
await GroupPermissionRepostory.update(
|
|
{ group: "admin" },
|
|
{ appCreate: false, appDelete: false }
|
|
);
|
|
}
|
|
}
|