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:
@ -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 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user