types.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import {Store} from "vuex";
  2. interface ItemsMenu extends Array<ItemMenu> {}
  3. interface ItemMenu {
  4. icon: string,
  5. title: string,
  6. to?: string,
  7. old?: boolean,
  8. children?: ItemsMenu
  9. }
  10. interface AbilitiesType {
  11. action: 'display' | 'read' | 'manage',
  12. subject: string,
  13. /** an array of fields to which user has (or not) access */
  14. fields?: string[]
  15. /** an object of conditions which restricts the rule scope */
  16. conditions?: any
  17. /** indicates whether rule allows or forbids something */
  18. inverted?: boolean
  19. /** message which explains why rule is forbidden */
  20. reason?: string
  21. }
  22. interface accessState {
  23. bearer: string,
  24. accessId: number,
  25. roles: Array<string>,
  26. abilities: Array<AbilitiesType>,
  27. isAdmin: boolean,
  28. isAdministratifManager: boolean,
  29. isPedagogicManager: boolean,
  30. isFinancialManager: boolean,
  31. isCaMember: boolean,
  32. isStudent: boolean,
  33. isTeacher: boolean,
  34. isMember: boolean,
  35. isOther: boolean
  36. }
  37. interface AccessStore extends Store<{profile:{access:accessState}}> {}
  38. interface organizationState {
  39. name: string,
  40. product: string,
  41. modules: Array<string>,
  42. hasChildren: boolean,
  43. }
  44. interface OrganizationStore extends Store<{profile:{organization:organizationState}}> {}
  45. interface AnyJson extends Record<string, any> {}
  46. interface AnyStore extends Store<any> {}