Add attachments (#733)

* Add attachments v1

* Refacto

* Add Policy checks

* Fix tests

* Remove generated files from git

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Félix Malfait
2023-07-19 00:24:03 +02:00
committed by GitHub
parent 84018efc7d
commit 10f7b08fdc
1130 changed files with 570 additions and 39762 deletions

View File

@ -14,6 +14,7 @@ import {
Pipeline,
PipelineStage,
PipelineProgress,
Attachment,
} from '@prisma/client';
import { AbilityAction } from './ability.action';
@ -30,6 +31,7 @@ type SubjectsAbility = Subjects<{
Pipeline: Pipeline;
PipelineStage: PipelineStage;
PipelineProgress: PipelineProgress;
Attachment: Attachment;
}>;
export type AppAbility = PureAbility<
@ -98,6 +100,11 @@ export class AbilityFactory {
// CommentThreadTarget
can(AbilityAction.Read, 'CommentThreadTarget');
// Attachment
can(AbilityAction.Read, 'Attachment', { workspaceId: workspace.id });
can(AbilityAction.Update, 'Attachment', { workspaceId: workspace.id });
can(AbilityAction.Create, 'Attachment', { workspaceId: workspace.id });
// Pipeline
can(AbilityAction.Read, 'Pipeline', { workspaceId: workspace.id });