All files / libs/kernel/auth/shared/src/abilities/dashboard-payments definitions.ts

95.12% Statements 39/41
100% Branches 7/7
77.77% Functions 7/9
95.12% Lines 39/41

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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421x 1x 1x 1x 1x 1x 135x 1x 1x 1x 45x 1x 1x 1x   1x 1x 1x   1x 1x 1x 28x 1x 1x 1x 50x 1x 1x 1x 43x 1x 1x 1x 64x 1x 1x 1x 1x 1x 1x  
import { SubjectsEnum, type DefinePermissions, type UserRoleForAccessControl } from '../../types';
 
import { DashboardPaymentsActions } from './actions';
 
export const dashboardPaymentsAbilityDefinitions = {
  ADMIN(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  READ_ONLY_ADMIN(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  SCOPED_ADMIN(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  SCOPED_READ_ONLY_ADMIN(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  FINANCE(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  MANAGER(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  READ_ONLY_MANAGER(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  EMPLOYEE(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
 
  READ_ONLY_EMPLOYEE(_, { can }) {
    can(DashboardPaymentsActions.view, SubjectsEnum.DashboardPayments);
  },
} as const satisfies Partial<Record<UserRoleForAccessControl, DefinePermissions>>;