All files / libs/kernel/auth/shared/src/abilities/dashboards-v2 subjects.ts

100% Statements 21/21
100% Branches 1/1
25% Functions 1/4
100% Lines 21/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import { subject } from '@casl/ability';
 
import { type Dashboard } from '@amalia/reporting/dashboards-v2/types';
 
import { SubjectsEnum } from '../../types';
 
export type ViewDashboardSubject = Pick<Dashboard, 'createdBy' | 'permissions'>;
export const viewDashboardSubject = (payload: ViewDashboardSubject) =>
  subject(SubjectsEnum.DashboardsV2, { ...payload });
 
export type ModifyDashboardSubject = Pick<Dashboard, 'createdBy' | 'permissions'>;
export const modifyDashboardSubject = (payload: ModifyDashboardSubject) =>
  subject(SubjectsEnum.DashboardsV2, { ...payload });
 
export type DeleteDashboardSubject = Pick<Dashboard, 'createdBy' | 'permissions'>;
export const deleteDashboardSubject = (payload: DeleteDashboardSubject) =>
  subject(SubjectsEnum.DashboardsV2, { ...payload });
 
export type ShareDashboardSubject = Pick<Dashboard, 'createdBy' | 'permissions'>;
export const shareDashboardSubject = (payload: ShareDashboardSubject) =>
  subject(SubjectsEnum.DashboardsV2, { ...payload });