@7365admin1/layer-common 4.2.15 → 4.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,540 @@
1
+ /**
2
+ * THE PROPERTY-MANAGEMENT ROLE CATALOGUE — the shared copy.
3
+ *
4
+ * This file used to exist TWICE, byte-identical, in `web-app-org` and in
5
+ * `web-app-property-management`. That is not a coincidence, it is the same
6
+ * catalogue: both apps build roles for the same estate, so a module ticked in
7
+ * one has to be tickable in the other.
8
+ *
9
+ * Two copies is how they drift. On 2026-09-05 the `-org` copy was found to be a
10
+ * strict SUBSET of `-property-management`'s — **32 permissions short**, nine
11
+ * whole families plus all six `access-card-mgmt` strings that
12
+ * `core/utils/hid-access.util.ts` actually enforces — so a role built through
13
+ * the onboarding wizard could never be granted them, and the modules were
14
+ * unreachable for anybody who joined that way. web-app-org #189 closed it by
15
+ * copying the file across, which left two identical copies and the same trap
16
+ * armed for the next edit.
17
+ *
18
+ * So it lives here now, once. An app that needs it imports nothing: Nuxt
19
+ * auto-imports this layer's composables, and an app-local file of the same name
20
+ * SHADOWS this one — which is why the app copies are deleted rather than left
21
+ * in place. `useCleaningPermission` has worked this way since it moved here.
22
+ *
23
+ * Nothing about the catalogue's CONTENT changed in the move: this is
24
+ * `web-app-org composables/usePropertyPermission.ts` at `origin/main`, verbatim.
25
+ */
26
+
27
+ export default function usePropertyPermission() {
28
+ const {
29
+ invitationPermissions,
30
+ memberPermissions,
31
+ rolePermissions,
32
+ feedbackPermissions,
33
+ workOrderPermissions,
34
+ visitorManagementPermissions,
35
+ buildingManagementPermissions,
36
+ buildingUnitManagementPermissions,
37
+ siteSettingsPermissions,
38
+
39
+ } = useCommonPermissions();
40
+
41
+
42
+ const permissions: TPermissions = {
43
+ members: memberPermissions,
44
+ roles: rolePermissions,
45
+ invitations: invitationPermissions,
46
+ feedbacks: feedbackPermissions,
47
+ workOrder: workOrderPermissions,
48
+ visitorManagement: visitorManagementPermissions,
49
+ buildingManagement: buildingManagementPermissions,
50
+ buildingUnitManagement: buildingUnitManagementPermissions,
51
+
52
+
53
+ "facility-mgmt": {
54
+ "add-facility": {
55
+ check: true,
56
+ description: "Allows the user to add a new facility to the system.",
57
+ },
58
+ "see-all-facility": {
59
+ check: true,
60
+ description: "Allows the user to view the list of all facilities.",
61
+ },
62
+ "see-facility-details": {
63
+ check: true,
64
+ description:
65
+ "Allows the user to view the details of a specific facility.",
66
+ },
67
+ "update-facility": {
68
+ check: true,
69
+ description: "Allows the user to update facility details.",
70
+ },
71
+ "delete-facility": {
72
+ check: true,
73
+ description:
74
+ "Allows the user to remove a facility from the system permanently.",
75
+ },
76
+ },
77
+ "facility-booking-mgmt": {
78
+ "add-facility-booking": {
79
+ check: true,
80
+ description:
81
+ "Allows the user to add a new facility-booking to the system.",
82
+ },
83
+ "see-all-facility-booking": {
84
+ check: true,
85
+ description: "Allows the user to view the list of all facilities.",
86
+ },
87
+ "see-facility-booking-details": {
88
+ check: true,
89
+ description:
90
+ "Allows the user to view the details of a specific facility-booking.",
91
+ },
92
+ "update-facility-booking": {
93
+ check: true,
94
+ description: "Allows the user to update facility-booking details.",
95
+ },
96
+ "delete-facility-booking": {
97
+ check: true,
98
+ description:
99
+ "Allows the user to remove a facility-booking from the system permanently.",
100
+ },
101
+ },
102
+ "event-mgmt": {
103
+ "add-event": {
104
+ check: true,
105
+ description: "Allows the user to add a new event to the system.",
106
+ },
107
+ "see-all-event": {
108
+ check: true,
109
+ description: "Allows the user to view the list of all facilities.",
110
+ },
111
+ "see-event-details": {
112
+ check: true,
113
+ description: "Allows the user to view the details of a specific event.",
114
+ },
115
+ "update-event": {
116
+ check: true,
117
+ description: "Allows the user to update event details.",
118
+ },
119
+ "delete-event": {
120
+ check: true,
121
+ description:
122
+ "Allows the user to remove a event from the system permanently.",
123
+ },
124
+ },
125
+
126
+ "bulletin-board-mgmt": {
127
+ "add-bulletin-board": {
128
+ check: true,
129
+ description:
130
+ "Allows the user to add a new bulletin-board to the system.",
131
+ },
132
+ "see-all-bulletin-board": {
133
+ check: true,
134
+ description: "Allows the user to view the list of all facilities.",
135
+ },
136
+ "see-bulletin-board-details": {
137
+ check: true,
138
+ description:
139
+ "Allows the user to view the details of a specific bulletin-board.",
140
+ },
141
+ "update-bulletin-board": {
142
+ check: true,
143
+ description: "Allows the user to update bulletin-board details.",
144
+ },
145
+ "delete-bulletin-board": {
146
+ check: true,
147
+ description:
148
+ "Allows the user to remove a bulletin-board from the system permanently.",
149
+ },
150
+ },
151
+ "people-mgmt": {
152
+ "add-people": {
153
+ check: true,
154
+ description: "Allows the user to add a new person to the system.",
155
+ },
156
+ "see-all-people": {
157
+ check: true,
158
+ description: "Allows the user to view the list of all people.",
159
+ },
160
+ "see-people-details": {
161
+ check: true,
162
+ description:
163
+ "Allows the user to view the details of a specific person.",
164
+ },
165
+ "update-people": {
166
+ check: true,
167
+ description: "Allows the user to update person details.",
168
+ },
169
+ "delete-people": {
170
+ check: true,
171
+ description:
172
+ "Allows the user to remove a person from the system permanently.",
173
+ },
174
+ "see-people-nric": {
175
+ check: true,
176
+ description: "Allows the user to see a person nric from the system.",
177
+ },
178
+ },
179
+
180
+ "bulletin-videos-mgmt": {
181
+ "add-bulletin-video": {
182
+ check: true,
183
+ description:
184
+ "Allows the user to add a new bulletin-video to the system.",
185
+ },
186
+ "see-all-bulletin-video": {
187
+ check: true,
188
+ description: "Allows the user to view the list of all facilities.",
189
+ },
190
+ "see-bulletin-video-details": {
191
+ check: true,
192
+ description:
193
+ "Allows the user to view the details of a specific bulletin-video.",
194
+ },
195
+ "update-bulletin-video": {
196
+ check: true,
197
+ description: "Allows the user to update bulletin-video details.",
198
+ },
199
+ "delete-bulletin-video": {
200
+ check: true,
201
+ description:
202
+ "Allows the user to remove a bulletin-video from the system permanently.",
203
+ },
204
+ },
205
+ "document-mgmt": {
206
+ "see-all-documents": {
207
+ check: true,
208
+ description:
209
+ "Allows the user to view the list of all documents. Checked by the iMA365 mobile app.",
210
+ },
211
+ "add-document": {
212
+ check: true,
213
+ description: "Allows the user to add a new document to the system.",
214
+ },
215
+ "add-folder": {
216
+ check: true,
217
+ description: "Allows the user to create a new folder in document management.",
218
+ },
219
+ "update-document": {
220
+ check: true,
221
+ description: "Allows the user to update document details.",
222
+ },
223
+ "delete-document": {
224
+ check: true,
225
+ description:
226
+ "Allows the user to remove a document from the system permanently.",
227
+ },
228
+ },
229
+ "access-card-mgmt": {
230
+ "see-all-card": {
231
+ check: true,
232
+ description: "Allows the user to view all access cards.",
233
+ },
234
+ "see-all-qr-tagging": {
235
+ check: true,
236
+ description: "Allows the user to view QR tagging.",
237
+ },
238
+ "add-access-card": {
239
+ check: true,
240
+ description: "Allows the user to add a new access card to the system.",
241
+ },
242
+ "update-access-card": {
243
+ check: true,
244
+ description: "Allows the user to update access card details.",
245
+ },
246
+ "delete-access-card": {
247
+ check: true,
248
+ description:
249
+ "Allows the user to remove an access card from the system permanently.",
250
+ },
251
+ view: {
252
+ check: true,
253
+ description: "Allows the user to view an access card's details.",
254
+ },
255
+ "assign-access-card": {
256
+ check: true,
257
+ description: "Allows the user to assign an access card to a person.",
258
+ },
259
+ "replace-access-card": {
260
+ check: true,
261
+ description:
262
+ "Allows the user to replace a lost or damaged access card with a new one.",
263
+ },
264
+ "manage-hid": {
265
+ check: true,
266
+ description:
267
+ "Allows the user to manage the HID door readers an access card opens.",
268
+ },
269
+ },
270
+ "service-provider-mgmt": {
271
+ "add-service-provider": {
272
+ check: true,
273
+ description:
274
+ "Allows the user to add a new service provider to the system.",
275
+ },
276
+ "invite-service-provider": {
277
+ check: true,
278
+ description:
279
+ "Allows the user to invite a new service provider to the system.",
280
+ },
281
+ "view-service-providers": {
282
+ check: true,
283
+ description:
284
+ "Allows the user to view the list of all service providers.",
285
+ },
286
+ },
287
+ "online-form-configuration": {
288
+ "add-online-form-configuration": {
289
+ check: true,
290
+ description:
291
+ "Allows the user to add a new online form configuration to the system.",
292
+ },
293
+ "update-online-form-configuration": {
294
+ check: true,
295
+ description:
296
+ "Allows the user to update online form configuration details.",
297
+ },
298
+ "delete-online-form-configuration": {
299
+ check: true,
300
+ description:
301
+ "Allows the user to remove an online form configuration from the system permanently.",
302
+ },
303
+ },
304
+ "billing-mgmt": {
305
+ "see-all-billing": {
306
+ check: true,
307
+ description:
308
+ "Allows the user to view billing on mobile. Checked by the iMA365 mobile app.",
309
+ },
310
+ "add-billing-configuration": {
311
+ check: true,
312
+ description:
313
+ "Allows the user to add a new billing configuration to the system.",
314
+ },
315
+ "see-billing-configuration-details": {
316
+ check: true,
317
+ description:
318
+ "Allows the user to view the details of billing configuration.",
319
+ },
320
+ "update-billing-configuration": {
321
+ check: true,
322
+ description: "Allows the user to update billing configuration details.",
323
+ },
324
+ "add-billing-items": {
325
+ check: true,
326
+ description:
327
+ "Allows the user to add a new billing items to the system.",
328
+ },
329
+ "see-all-billing-items": {
330
+ check: true,
331
+ description: "Allows the user to view the list of all billing items.",
332
+ },
333
+ "see-billing-items-details": {
334
+ check: true,
335
+ description:
336
+ "Allows the user to view the details of a specific billing items.",
337
+ },
338
+ "update-billing-items": {
339
+ check: true,
340
+ description: "Allows the user to update billing items details.",
341
+ },
342
+ "delete-billing-items": {
343
+ check: true,
344
+ description:
345
+ "Allows the user to remove a billing items from the system permanently.",
346
+ },
347
+ "see-all-billing-summary": {
348
+ check: true,
349
+ description: "Allows the user to view the list of all billing summary.",
350
+ },
351
+ },
352
+ "SOA-mgmt": {
353
+ "add-soa": {
354
+ check: true,
355
+ description: "Allows the user to add a new soa to the system.",
356
+ },
357
+ "see-all-soa": {
358
+ check: true,
359
+ description: "Allows the user to view the all soa request.",
360
+ },
361
+ "see-soa-details": {
362
+ check: true,
363
+ description: "Allows the user to view the details of soa.",
364
+ },
365
+ "download-soa": {
366
+ check: true,
367
+ description: "Allows the user to download soa.",
368
+ },
369
+ },
370
+ "incident-reports": {
371
+ "see-all-incident-reports": {
372
+ check: true,
373
+ description:
374
+ "Allows the user to view the list of all incident reports on mobile. Checked by the iMA365 mobile app.",
375
+ },
376
+ "see-incident-reports": {
377
+ check: true,
378
+ description:
379
+ "Allows the user to view the list of all incident reports.",
380
+ },
381
+ "review-incident-report": {
382
+ check: true,
383
+ description: "Allows the user to approve or reject incident report.",
384
+ },
385
+ },
386
+
387
+ "vehicle-mgmt": {
388
+ "add-vehicle": {
389
+ check: true,
390
+ description: "Allows the user to add a new vehicle to the system.",
391
+ },
392
+ "see-all-vehicles": {
393
+ check: true,
394
+ description: "Allows the user to view the list of all vehicles.",
395
+ },
396
+ "see-vehicle-details": {
397
+ check: true,
398
+ description:
399
+ "Allows the user to view the details of a specific vehicle.",
400
+ },
401
+ "update-vehicle": {
402
+ check: true,
403
+ description: "Allows the user to update vehicle details.",
404
+ },
405
+ "delete-vehicle": {
406
+ check: true,
407
+ description:
408
+ "Allows the user to remove a vehicle from the system permanently.",
409
+ },
410
+ "approve-vehicle": {
411
+ check: true,
412
+ description:
413
+ "Allows the user to approve a vehicle pending requests.",
414
+ }
415
+ },
416
+
417
+ "emergency-contact": {
418
+ "see-all-emergency-contacts": {
419
+ check: true,
420
+ description:
421
+ "Allows the user to view the list of all emergency contacts on mobile. Checked by the iMA365, iGarden365 and iClean365 mobile apps.",
422
+ },
423
+ "add-emergency-contact-category": {
424
+ check: true,
425
+ description:
426
+ "Allows the user to add a new emergency contact category to the system.",
427
+ },
428
+ "delete-emergency-contact-category": {
429
+ check: true,
430
+ description:
431
+ "Allows the user to add a new emergency contact category to the system.",
432
+ },
433
+ "add-emergency-contact": {
434
+ check: true,
435
+ description:
436
+ "Allows the user to add a new emergency contact to the system.",
437
+ },
438
+ "see-all": {
439
+ check: true,
440
+ description:
441
+ "Allows the user to view the list of all emergency contacts.",
442
+ },
443
+ "see-details": {
444
+ check: true,
445
+ description:
446
+ "Allows the user to view the details of a specific emergency contact.",
447
+ },
448
+ "update-emergency-contact": {
449
+ check: true,
450
+ description: "Allows the user to update emergency contact details.",
451
+ },
452
+ "delete-emergency-contact": {
453
+ check: true,
454
+ description:
455
+ "Allows the user to remove an emergency contact from the system permanently.",
456
+ },
457
+ },
458
+
459
+ "nfc-patrol": {
460
+ "see-all-nfc-patrol": {
461
+ check: true,
462
+ description:
463
+ "Allows the user to view created routes and patrol logs.",
464
+ },
465
+ "add-nfc-patrol": {
466
+ check: true,
467
+ description: "Allows the user to add routes.",
468
+ },
469
+ "update-nfc-patrol": {
470
+ check: true,
471
+ description: "Allows the user to edit routes.",
472
+ },
473
+ "delete-nfc-patrol": {
474
+ check: true,
475
+ description: "Allows the user to delete routes.",
476
+ },
477
+ },
478
+
479
+ "entry-pass-mgmt": {
480
+ "view-entry-pass-settings": {
481
+ check: true,
482
+ description:
483
+ "Allows the user to view the entry pass settings for a site.",
484
+ },
485
+ "add-entry-pass-settings": {
486
+ check: true,
487
+ description: "Allows the user to add entry pass settings for a site.",
488
+ },
489
+ "update-entry-pass-settings": {
490
+ check: true,
491
+ description:
492
+ "Allows the user to update the entry pass settings for a site.",
493
+ },
494
+ },
495
+ // The five modules below are gated ONLY by the iMA365 mobile app, which
496
+ // reads the literal "<resource>:<action>" string off role.permissions[] and
497
+ // does not import layer-common. Without an entry here no role editor could
498
+ // grant them, so the modules could never be switched on for anybody.
499
+ "access-control": {
500
+ "see-all-access-control": {
501
+ check: true,
502
+ description:
503
+ "Allows the user to open access control on mobile. Checked by the iMA365 mobile app.",
504
+ },
505
+ },
506
+ "passes-and-keys-mgmt": {
507
+ "see-all-passes-and-keys": {
508
+ check: true,
509
+ description:
510
+ "Allows the user to view the list of all passes and keys on mobile. Checked by the iMA365 mobile app.",
511
+ },
512
+ },
513
+ "online-forms": {
514
+ "see-all-online-forms": {
515
+ check: true,
516
+ description:
517
+ "Allows the user to view the list of all online forms on mobile. Checked by the iMA365 mobile app.",
518
+ },
519
+ },
520
+ blocklist: {
521
+ "see-all-blocklist": {
522
+ check: true,
523
+ description:
524
+ "Allows the user to view the blocklist on mobile. Checked by the iMA365 mobile app.",
525
+ },
526
+ },
527
+ "resident-transactions": {
528
+ "see-all-resident-transactions": {
529
+ check: true,
530
+ description:
531
+ "Allows the user to view the list of all resident transactions on mobile. Checked by the iMA365 mobile app.",
532
+ },
533
+ },
534
+ "site-settings": siteSettingsPermissions
535
+ };
536
+
537
+ return {
538
+ permissions,
539
+ };
540
+ }