UserMembershipEntityConfigs.mjs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. module.exports = {
  2. group: {
  3. modelName: 'Subscription',
  4. readOnly: true,
  5. hasMembersLimit: true,
  6. fields: {
  7. primaryKey: '_id',
  8. read: ['invited_emails', 'teamInvites', 'member_ids'],
  9. write: null,
  10. access: 'manager_ids',
  11. membership: 'member_ids',
  12. name: 'teamName',
  13. },
  14. baseQuery: {
  15. groupPlan: true,
  16. },
  17. },
  18. team: {
  19. // for metrics only
  20. modelName: 'Subscription',
  21. fields: {
  22. primaryKey: 'overleaf.id',
  23. access: 'manager_ids',
  24. },
  25. baseQuery: {
  26. groupPlan: true,
  27. },
  28. },
  29. groupManagers: {
  30. modelName: 'Subscription',
  31. fields: {
  32. primaryKey: '_id',
  33. read: ['manager_ids'],
  34. write: 'manager_ids',
  35. access: 'manager_ids',
  36. membership: 'member_ids',
  37. name: 'teamName',
  38. },
  39. baseQuery: {
  40. groupPlan: true,
  41. },
  42. },
  43. groupMember: {
  44. modelName: 'Subscription',
  45. readOnly: true,
  46. hasMembersLimit: true,
  47. fields: {
  48. primaryKey: '_id',
  49. read: ['member_ids'],
  50. write: null,
  51. access: 'member_ids',
  52. membership: 'member_ids',
  53. name: 'teamName',
  54. },
  55. baseQuery: {
  56. groupPlan: true,
  57. },
  58. },
  59. groupAdmin: {
  60. modelName: 'Subscription',
  61. fields: {
  62. primaryKey: '_id',
  63. read: ['admin_id'],
  64. write: null,
  65. access: 'admin_id',
  66. membership: 'admin_id',
  67. name: 'teamName',
  68. },
  69. baseQuery: {
  70. groupPlan: true,
  71. },
  72. },
  73. institution: {
  74. modelName: 'Institution',
  75. fields: {
  76. primaryKey: 'v1Id',
  77. read: ['managerIds'],
  78. write: 'managerIds',
  79. access: 'managerIds',
  80. membership: 'member_ids',
  81. name: 'name',
  82. },
  83. pathsFor(id) {
  84. return {
  85. index: `/manage/institutions/${id}/managers`,
  86. }
  87. },
  88. },
  89. publisher: {
  90. modelName: 'Publisher',
  91. fields: {
  92. primaryKey: 'slug',
  93. read: ['managerIds'],
  94. write: 'managerIds',
  95. access: 'managerIds',
  96. membership: 'member_ids',
  97. name: 'name',
  98. },
  99. pathsFor(id) {
  100. return {
  101. index: `/manage/publishers/${id}/managers`,
  102. }
  103. },
  104. },
  105. }