@7365admin1/layer-common 4.2.16 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.2.17
4
+
5
+ ### Patch Changes
6
+
7
+ - bd3614a: Move the security and landscape role catalogues into the layer
8
+
9
+ `useSecurityPermission` lived only in `web-app-security` and
10
+ `useLandscapingPermission` only in `web-app-landscape`. Each was one copy-paste
11
+ away from the drift `usePropertyPermission` actually suffered — 32 permissions
12
+ missing from `web-app-org`'s copy, including every `access-card-mgmt` string the
13
+ API enforces, so those modules could not be granted at all.
14
+
15
+ Both files move here verbatim (content unchanged, header added) and are pinned
16
+ by `test/shared-role-catalogues.test.mjs`: resource lists, both feedback
17
+ spellings, and every action in both catalogues driven through the real
18
+ `hasPermission` so no existing grant can become unreachable.
19
+
20
+ Additive in the layer. The app copies shadow these until the app PRs delete
21
+ them, so nothing changes for a consumer until it bumps and deletes.
22
+
3
23
  ## 4.2.16
4
24
 
5
25
  ### Patch Changes
@@ -640,11 +660,11 @@
640
660
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
641
661
  own rule from two endpoints the console already calls, unprojected:
642
662
 
643
- GET /api/members/user/:user/app/admin the Seven365 staff membership
644
- GET /api/roles/id/:role that membership's role document
663
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
664
+ GET /api/roles/id/:role that membership's role document
645
665
 
646
- owner = member.type === "admin" && role.type === "admin" && role.default === true
647
- staff = member.type === "admin" && role.type === "admin"
666
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
667
+ staff = member.type === "admin" && role.type === "admin"
648
668
 
649
669
  `role.default` is the marker because it is the only property of a platform
650
670
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -0,0 +1,250 @@
1
+ /**
2
+ * THE LANDSCAPE ROLE CATALOGUE — the shared copy.
3
+ *
4
+ * Same reason as `useSecurityPermission` in this folder: it lived only in
5
+ * `web-app-landscape`, one copy-paste away from the 32-permission drift that
6
+ * `usePropertyPermission` actually suffered. An app-local composable SHADOWS a
7
+ * layer one silently, so this file does nothing until the app copy is DELETED —
8
+ * which the accompanying app PR does.
9
+ *
10
+ * `hasPermission` resolves an action as `catalogue[resource][action]`: a
11
+ * resource missing here can only ever answer `false`, and no role editor can
12
+ * express the module. Widen, never swap.
13
+ *
14
+ * Nothing about the catalogue's CONTENT changed in the move: this is
15
+ * `web-app-landscape composables/useLandscapingPermission.ts` at `origin/main`,
16
+ * verbatim apart from this header. Pinned by `test/shared-role-catalogues.test.mjs`.
17
+ */
18
+ export default function useLandscapingPermission() {
19
+ const {
20
+ invitationPermissions,
21
+ memberPermissions,
22
+ rolePermissions,
23
+ feedbackPermissions,
24
+ workOrderPermissions,
25
+ bulletinBoardPermissions,
26
+ serviceProviderPermissions,
27
+
28
+ } = useCommonPermissions();
29
+ const permissions: TPermissions = {
30
+ members: memberPermissions,
31
+ roles: rolePermissions,
32
+ invitations: invitationPermissions,
33
+ feedbacks: feedbackPermissions,
34
+ work_orders: workOrderPermissions,
35
+ "bulletin-board": bulletinBoardPermissions,
36
+ "service-provider-mgmt": serviceProviderPermissions,
37
+ inventory: {
38
+ "view-inventory": {
39
+ check: true,
40
+ description: "Allows the user to view the inventory list.",
41
+ },
42
+ },
43
+ // area management permissions
44
+ "area-mgmt": {
45
+ "see-all-areas": {
46
+ check: true,
47
+ description: "Allows the user to view the list of all areas for a site.",
48
+ },
49
+ "add-area": {
50
+ check: true,
51
+ description: "Allows the user to create/add an area to a site.",
52
+ },
53
+ "update-area": {
54
+ check: true,
55
+ description: "Allows the user to update/edit area details.",
56
+ },
57
+ "import-areas": {
58
+ check: true,
59
+ description: "Allows the user to import/upload areas via CSV/XLSX.",
60
+ },
61
+ "see-area-details": {
62
+ check: true,
63
+ description: "Allows the user to view detailed information for an area.",
64
+ },
65
+ "delete-area": {
66
+ check: true,
67
+ description: "Allows the user to delete/remove an area.",
68
+ },
69
+ },
70
+ // unit management permissions
71
+ "unit-mgmt": {
72
+ "see-all-units": {
73
+ check: true,
74
+ description: "Allows the user to view the list of all units for a site.",
75
+ },
76
+ "add-unit": {
77
+ check: true,
78
+ description: "Allows the user to create/add a unit to a site.",
79
+ },
80
+ "update-unit": {
81
+ check: true,
82
+ description: "Allows the user to update/edit unit details.",
83
+ },
84
+ "import-units": {
85
+ check: true,
86
+ description: "Allows the user to import/upload units via CSV/XLSX.",
87
+ },
88
+ "see-unit-details": {
89
+ check: true,
90
+ description: "Allows the user to view detailed information for a unit.",
91
+ },
92
+ "delete-unit": {
93
+ check: true,
94
+ description: "Allows the user to delete/remove a unit.",
95
+ },
96
+ },
97
+ // landscape schedule management permissions
98
+ "landscape-schedule-mgmt": {
99
+ "see-all-schedules": {
100
+ check: true,
101
+ description: "Allows the user to view the list of all cleaning schedules.",
102
+ },
103
+ "see-schedule-details": {
104
+ check: true,
105
+ description: "Allows the user to view detailed information for a cleaning schedule.",
106
+ },
107
+ "download-schedule": {
108
+ check: true,
109
+ description: "Allows the user to download cleaning schedule data.",
110
+ },
111
+ "manage-schedule-tasks": {
112
+ check: true,
113
+ description: "Allows the user to manage and update cleaning schedule tasks.",
114
+ },
115
+ "generate-checklist": {
116
+ check: true,
117
+ description: "Allows the user to generate new cleaning checklists.",
118
+ },
119
+ "view-history": {
120
+ check: true,
121
+ description: "Allows the user to view cleaning schedule history.",
122
+ },
123
+ "add-remarks": {
124
+ check: true,
125
+ description: "Allows the user to add remarks to cleaning tasks.",
126
+ },
127
+ },
128
+ // schedule task management permissions
129
+ "schedule-task-mgmt": {
130
+ "see-all-schedule-tasks": {
131
+ check: true,
132
+ description: "Allows the user to view the list of all schedule tasks.",
133
+ },
134
+ "add-schedule-task": {
135
+ check: true,
136
+ description: "Allows the user to create/add a new schedule task.",
137
+ },
138
+ "update-schedule-task": {
139
+ check: true,
140
+ description: "Allows the user to update/edit schedule task details.",
141
+ },
142
+ "delete-schedule-task": {
143
+ check: true,
144
+ description: "Allows the user to delete/remove a schedule task.",
145
+ },
146
+ "see-schedule-task-details": {
147
+ check: true,
148
+ description: "Allows the user to view detailed information for a schedule task.",
149
+ },
150
+ },
151
+ // attendance management permissions
152
+ "attendance-mgmt": {
153
+ "see-all-attendance": {
154
+ check: true,
155
+ description: "Allows the user to view all team members' attendance records.",
156
+ },
157
+ "see-attendance-details": {
158
+ check: true,
159
+ description: "Allows the user to view detailed information for an attendance record.",
160
+ },
161
+ "manage-attendance-settings": {
162
+ check: true,
163
+ description: "Allows the user to configure and manage attendance settings.",
164
+ },
165
+ },
166
+ // my attendance permissions
167
+ "my-attendance": {
168
+ "see-own-attendance": {
169
+ check: true,
170
+ description: "Allows the user to view their own attendance records.",
171
+ },
172
+ "check-in-out": {
173
+ check: true,
174
+ description: "Allows the user to check in and check out.",
175
+ },
176
+ },
177
+ // equipment management permissions
178
+ "supply-mgmt": {
179
+ "see-all-supplies": {
180
+ check: true,
181
+ description: "Allows the user to view the list of all equipments.",
182
+ },
183
+ "add-supply": {
184
+ check: true,
185
+ description: "Allows the user to create/add a new equipment item.",
186
+ },
187
+ "update-supply": {
188
+ check: true,
189
+ description: "Allows the user to update/edit equipment details.",
190
+ },
191
+ "delete-supply": {
192
+ check: true,
193
+ description: "Allows the user to delete/remove an equipment item.",
194
+ },
195
+ "add-stock": {
196
+ check: true,
197
+ description: "Allows the user to add stock to equipment items.",
198
+ },
199
+ "view-stock": {
200
+ check: true,
201
+ description: "Allows the user to view stock history and details.",
202
+ },
203
+ "checkout-item": {
204
+ check: true,
205
+ description: "Allows the user to checkout equipment items.",
206
+ },
207
+ },
208
+ // checkout item management permissions
209
+ "checkout-item-mgmt": {
210
+ "see-all-checkouts": {
211
+ check: true,
212
+ description: "Allows the user to view all item checkouts.",
213
+ },
214
+ "create-checkout": {
215
+ check: true,
216
+ description: "Allows the user to create new item checkouts.",
217
+ },
218
+ "update-checkout": {
219
+ check: true,
220
+ description: "Allows the user to update/edit item checkouts.",
221
+ },
222
+ "approve-checkout": {
223
+ check: true,
224
+ description: "Allows the user to approve item checkouts.",
225
+ },
226
+ "disapprove-checkout": {
227
+ check: true,
228
+ description: "Allows the user to disapprove item checkouts.",
229
+ },
230
+ "view-checkout-details": {
231
+ check: true,
232
+ description: "Allows the user to view detailed information for item checkouts.",
233
+ },
234
+ },
235
+ "site-settings": {
236
+ "can-view-site-settings": {
237
+ check: true,
238
+ description: "Allows the user to view site settings.",
239
+ },
240
+ "can-manage-site-settings": {
241
+ check: true,
242
+ description: "Allows the user to manage site settings.",
243
+ },
244
+ },
245
+ };
246
+
247
+ return {
248
+ permissions,
249
+ };
250
+ }
@@ -0,0 +1,593 @@
1
+ /**
2
+ * THE SECURITY ROLE CATALOGUE — the shared copy.
3
+ *
4
+ * It lived only in `web-app-security`, where nothing stopped it drifting from
5
+ * the other verticals the way `usePropertyPermission` had already drifted 32
6
+ * permissions apart between `-org` and `-property-management`. Moving it here
7
+ * is what makes that drift impossible: an app-local composable SHADOWS a layer
8
+ * one silently — it type-checks and it builds — so the move only takes effect
9
+ * once the app copy is DELETED, which the accompanying app PR does.
10
+ *
11
+ * A catalogue is not decoration. `hasPermission` resolves an action as
12
+ * `catalogue[resource][action]`, so a resource missing from this file can never
13
+ * answer anything but `false`, and the role editor cannot express the module at
14
+ * all. Widen, never swap: an existing spelling stays even when a newer one is
15
+ * added beside it (see the `see-all-feedback` note below), because removing one
16
+ * would silently un-grant every role that already holds it.
17
+ *
18
+ * Nothing about the catalogue's CONTENT changed in the move: this is
19
+ * `web-app-security composables/useSecurityPermission.ts` at `origin/main`,
20
+ * verbatim apart from this header. Pinned by `test/shared-role-catalogues.test.mjs`.
21
+ */
22
+ export default function useSecurityPermission() {
23
+ const {
24
+ memberPermissions,
25
+ invitationPermissions,
26
+ rolePermissions,
27
+ siteSettingsPermissions,
28
+ bulletinBoardPermissions,
29
+
30
+ } = useCommonPermissions();
31
+
32
+ const permissions: TPermissions = {
33
+ feedbacks: {
34
+ "add-feedback": {
35
+ check: true,
36
+ description: "Allows the user to add a new feedback to the system.",
37
+ },
38
+ "see-all-feedbacks": {
39
+ check: true,
40
+ description: "Allows the user to view the list of all feedbacks.",
41
+ },
42
+ // The spelling the great majority of live roles actually hold, and the
43
+ // one the iSecure365 mobile app checks. Offered so an administrator can
44
+ // reproduce an existing grant.
45
+ "see-all-feedback": {
46
+ check: true,
47
+ description: "Allows the user to view the list of all feedbacks.",
48
+ },
49
+ "see-feedback-details": {
50
+ check: true,
51
+ description:
52
+ "Allows the user to view the details of a specific feedback.",
53
+ },
54
+ "update-feedback": {
55
+ check: true,
56
+ description: "Allows the user to update feedback details.",
57
+ },
58
+ "delete-feedback": {
59
+ check: true,
60
+ description:
61
+ "Allows the user to remove a feedback from the system permanently.",
62
+ },
63
+ },
64
+
65
+ work_orders: {
66
+ "add-work-order": {
67
+ check: true,
68
+ description: "Allows the user to add a new work-order to the system.",
69
+ },
70
+ "see-all-work-orders": {
71
+ check: true,
72
+ description: "Allows the user to view the list of all work-orders.",
73
+ },
74
+ "see-work-order-details": {
75
+ check: true,
76
+ description:
77
+ "Allows the user to view the details of a specific work-order.",
78
+ },
79
+ "update-work-order": {
80
+ check: true,
81
+ description: "Allows the user to update work-order details.",
82
+ },
83
+ "delete-work-order": {
84
+ check: true,
85
+ description:
86
+ "Allows the user to remove a work-order from the system permanently.",
87
+ },
88
+ },
89
+
90
+ "building-mgmt": {
91
+ "add-building": {
92
+ check: true,
93
+ description: "Allows the user to add a new building to the system.",
94
+ },
95
+ "see-all-buildings": {
96
+ check: true,
97
+ description: "Allows the user to view the list of all buildings.",
98
+ },
99
+ "see-building-details": {
100
+ check: true,
101
+ description:
102
+ "Allows the user to view the details of a specific building.",
103
+ },
104
+ "update-building": {
105
+ check: true,
106
+ description: "Allows the user to update building details.",
107
+ },
108
+ "delete-building": {
109
+ check: true,
110
+ description:
111
+ "Allows the user to remove a building from the system permanently.",
112
+ },
113
+ },
114
+
115
+ "vehicle-mgmt": {
116
+ "add-vehicle": {
117
+ check: true,
118
+ description: "Allows the user to add a new vehicle to the system.",
119
+ },
120
+ "see-all-vehicles": {
121
+ check: true,
122
+ description: "Allows the user to view the list of all vehicles.",
123
+ },
124
+ "see-vehicle-details": {
125
+ check: true,
126
+ description:
127
+ "Allows the user to view the details of a specific vehicle.",
128
+ },
129
+ "update-vehicle": {
130
+ check: true,
131
+ description: "Allows the user to update vehicle details.",
132
+ },
133
+ "delete-vehicle": {
134
+ check: true,
135
+ description:
136
+ "Allows the user to remove a vehicle from the system permanently.",
137
+ },
138
+
139
+ "approve-vehicle": {
140
+ check: true,
141
+ description:
142
+ "Allows the user to approve a vehicle pending requests.",
143
+ }
144
+ },
145
+
146
+ "daily-occurrence-books": {
147
+ "add-daily-occurrence": {
148
+ check: true,
149
+ description:
150
+ "Allows the user to add a new Daily Occurrence to the system.",
151
+ },
152
+ "see-all-daily-occurrence": {
153
+ check: true,
154
+ description:
155
+ "Allows the user to view the list of all Daily Occurrence.",
156
+ },
157
+ "see-daily-occurrence-details": {
158
+ check: true,
159
+ description:
160
+ "Allows the user to view the details of a specific Daily Occurrence.",
161
+ },
162
+ "update-daily-occurrence": {
163
+ check: true,
164
+ description: "Allows the user to update Daily Occurrence details.",
165
+ },
166
+ "delete-daily-occurrence": {
167
+ check: true,
168
+ description:
169
+ "Allows the user to remove a Daily Occurrence from the system permanently.",
170
+ },
171
+ },
172
+
173
+ "virtual-patrol": {
174
+ "add-virtual-patrol-route": {
175
+ check: true,
176
+ description: "Allows the user to add a new route to the system.",
177
+ },
178
+ "see-all-virtual-patrol-route": {
179
+ check: true,
180
+ description: "Allows the user to view the list of all routes.",
181
+ },
182
+ "see-virtual-patrol-route-details": {
183
+ check: true,
184
+ description: "Allows the user to view the details of a specific route.",
185
+ },
186
+ "update-virtual-patrol-route": {
187
+ check: true,
188
+ description: "Allows the user to update route details.",
189
+ },
190
+ "delete-virtual-patrol-route": {
191
+ check: true,
192
+ description:
193
+ "Allows the user to remove a route from the system permanently.",
194
+ },
195
+ "start-virtual-patrol-route": {
196
+ check: true,
197
+ description:
198
+ "Allows the user to start virtual patroling on a specific route.",
199
+ },
200
+ "add-virtual-patrol-question": {
201
+ check: true,
202
+ description: "Allows the user to add a new question to the system.",
203
+ },
204
+ "see-all-virtual-patrol-question": {
205
+ check: true,
206
+ description: "Allows the user to view the list of all questions.",
207
+ },
208
+ "see-virtual-patrol-question-details": {
209
+ check: true,
210
+ description:
211
+ "Allows the user to view the details of a specific question.",
212
+ },
213
+ "update-virtual-patrol-question": {
214
+ check: true,
215
+ description: "Allows the user to update question details.",
216
+ },
217
+ "delete-virtual-patrol-question": {
218
+ check: true,
219
+ description:
220
+ "Allows the user to remove a question from the system permanently.",
221
+ },
222
+ "add-virtual-patrol-log": {
223
+ check: true,
224
+ description: "Allows the user to add a new log to the system.",
225
+ },
226
+ "see-all-virtual-patrol-logs": {
227
+ check: true,
228
+ description: "Allows the user to view the list of all logs.",
229
+ },
230
+ "see-virtual-patrol-log-details": {
231
+ check: true,
232
+ description: "Allows the user to view the details of a specific log.",
233
+ },
234
+ "update-virtual-patrol-log": {
235
+ check: true,
236
+ description: "Allows the user to update log details.",
237
+ },
238
+ "delete-virtual-patrol-log": {
239
+ check: true,
240
+ description:
241
+ "Allows the user to remove a log from the system permanently.",
242
+ },
243
+ },
244
+ "robot-mgmt": {
245
+ "add-robot": {
246
+ check: true,
247
+ description: "Allows the user to add a new robot to the system.",
248
+ },
249
+ "see-all-robots": {
250
+ check: true,
251
+ description: "Allows the user to view the list of all robots.",
252
+ },
253
+ "see-robot-details": {
254
+ check: true,
255
+ description: "Allows the user to view the details of a specific robot.",
256
+ },
257
+ "update-robot": {
258
+ check: true,
259
+ description: "Allows the user to update robot details.",
260
+ },
261
+ "delete-robot": {
262
+ check: true,
263
+ description:
264
+ "Allows the user to remove a robot from the system permanently.",
265
+ },
266
+ },
267
+
268
+ "visitor-mgmt": {
269
+ "add-visitor": {
270
+ check: true,
271
+ description: "Allows the user to add a new visitor to the system.",
272
+ },
273
+ "see-all-visitor": {
274
+ check: true,
275
+ description: "Allows the user to view the list of all visitors.",
276
+ },
277
+ "see-visitor-details": {
278
+ check: true,
279
+ description:
280
+ "Allows the user to view the details of a specific visitor.",
281
+ },
282
+ "update-visitor": {
283
+ check: true,
284
+ description: "Allows the user to update visitor details.",
285
+ },
286
+ "delete-visitor": {
287
+ check: true,
288
+ description:
289
+ "Allows the user to remove a visitor from the system permanently.",
290
+ },
291
+ },
292
+
293
+ // "guest-mgmt": {
294
+ // "add-guest": {
295
+ // check: true,
296
+ // description: "Allows the user to add a new guest to the system.",
297
+ // },
298
+ // "see-all-guest": {
299
+ // check: true,
300
+ // description: "Allows the user to view the list of all guests.",
301
+ // },
302
+ // "see-guest-details": {
303
+ // check: true,
304
+ // description: "Allows the user to view the details of a specific guest.",
305
+ // },
306
+ // "update-guest": {
307
+ // check: true,
308
+ // description: "Allows the user to update guest details.",
309
+ // },
310
+ // "delete-guest": {
311
+ // check: true,
312
+ // description:
313
+ // "Allows the user to remove a guest from the system permanently.",
314
+ // },
315
+ // },
316
+
317
+ customers: {
318
+ "add-customer": {
319
+ check: true,
320
+ description: "Allows the user to add a new customer to the system.",
321
+ },
322
+ "see-all-customers": {
323
+ check: true,
324
+ description: "Allows the user to view the list of all customers.",
325
+ },
326
+ "see-customer-details": {
327
+ check: true,
328
+ description:
329
+ "Allows the user to view the details of a specific customer.",
330
+ },
331
+ "delete-customer": {
332
+ check: true,
333
+ description:
334
+ "Allows the user to remove a customer from the system permanently.",
335
+ },
336
+ },
337
+ subscriptions: {
338
+ "management-subscription": {
339
+ check: true,
340
+ description:
341
+ "Allows the user to manage subscription plans, including creating, updating, and deleting plans.",
342
+ },
343
+ "view-subscription-details": {
344
+ check: true,
345
+ description:
346
+ "Allows the user to view the details of a specific subscription plan.",
347
+ },
348
+ },
349
+
350
+ "daily-occurrence-entries": {
351
+ "add-daily-occurrence-entries": {
352
+ check: true,
353
+ description:
354
+ "Allows the user to add a new daily-occurrence-entries to the system.",
355
+ },
356
+ "update-daily-occurrence-entries": {
357
+ check: true,
358
+ description:
359
+ "Allows the user to update a daily-occurrence-entries in the system.",
360
+ },
361
+ "see-daily-occurrence-entries-details": {
362
+ check: true,
363
+ description:
364
+ "Allows the user to view the details of a specific daily-occurrence-entries.",
365
+ },
366
+ "delete-daily-occurrence-entries": {
367
+ check: true,
368
+ description:
369
+ "Allows the user to remove a daily-occurrence-entries from the system permanently.",
370
+ },
371
+ },
372
+
373
+ "incident-reports": {
374
+ // LEGACY SPELLING -- missing an "i". It is live in role data and the
375
+ // iSecure365 mobile app accepts it, so it is offered here for those
376
+ // roles. Prefer "see-incident-reports" for anything new.
377
+ "see-ncident-reports": {
378
+ check: true,
379
+ description:
380
+ "Legacy spelling of the incident reports view right, kept for existing roles that hold it. Grant \"see-incident-reports\" instead for new roles.",
381
+ },
382
+ "see-incident-reports": {
383
+ check: true,
384
+ description:
385
+ "Allows the user to view the list of all incident reports.",
386
+ },
387
+ "add-incident-report": {
388
+ check: true,
389
+ description:
390
+ "Allows the user to add a new incident report to the system.",
391
+ },
392
+ "update-incident-report": {
393
+ check: true,
394
+ description:
395
+ "Allows the user to update a incident report in the system.",
396
+ },
397
+ "see-incident-report-details": {
398
+ check: true,
399
+ description:
400
+ "Allows the user to view the details of a specific incident report.",
401
+ },
402
+ "delete-incident-report": {
403
+ check: true,
404
+ description:
405
+ "Allows the user to remove a incident report from the system permanently.",
406
+ },
407
+ },
408
+ "manpower-monitoring": {
409
+ "save-manpower-monitoring-general-settings": {
410
+ check: true,
411
+ description:
412
+ "Allows the user to add and save new settings to the system.",
413
+ },
414
+ "see-all-manpower-monitoring-settings": {
415
+ check: true,
416
+ description: "Allows the user to view manpower settings.",
417
+ },
418
+ "save-manpower-monitoring-designation-settings": {
419
+ check: true,
420
+ description:
421
+ "Allows the user to add and save new designation and designation count to the system.",
422
+ },
423
+ "see-all-manpower-monitoring-attendance": {
424
+ check: true,
425
+ description: "Allows the user to view manpower attendance.",
426
+ },
427
+ "download-manpower-monitoring-attendance": {
428
+ check: true,
429
+ description: "Allows the user to download manpower attendance.",
430
+ },
431
+ "see-all-manpower-monitoring-sites": {
432
+ check: true,
433
+ description: "Allows the user to view manpower sites.",
434
+ },
435
+ "see-manpower-monitoring-sites-detail": {
436
+ check: true,
437
+ description:
438
+ "Allows the user to view the details of a specific manpower sites.",
439
+ },
440
+ "delete-manpower-sites": {
441
+ check: true,
442
+ description:
443
+ "Allows the user to remove a manpower site from the system permanently.",
444
+ },
445
+ },
446
+
447
+ "attendance-mgmt": {
448
+ "see-all-attendance": {
449
+ check: true,
450
+ description:
451
+ "Allows the user to view all team members' attendance records.",
452
+ },
453
+ "see-attendance-details": {
454
+ check: true,
455
+ description:
456
+ "Allows the user to view detailed information for an attendance record.",
457
+ },
458
+ "manage-attendance-settings": {
459
+ check: true,
460
+ description:
461
+ "Allows the user to configure and manage attendance settings.",
462
+ },
463
+ },
464
+
465
+ "my-attendance": {
466
+ "see-own-attendance": {
467
+ check: true,
468
+ description: "Allows the user to view their own attendance records.",
469
+ },
470
+ "check-in-out": {
471
+ check: true,
472
+ description: "Allows the user to check in and check out.",
473
+ },
474
+ },
475
+
476
+ "unit-mgmt": {
477
+ "see-all-units": {
478
+ check: true,
479
+ description: "Allows the user to view the list of all units for a site.",
480
+ },
481
+ "add-unit": {
482
+ check: true,
483
+ description: "Allows the user to create/add a unit to a site.",
484
+ },
485
+ "update-unit": {
486
+ check: true,
487
+ description: "Allows the user to update/edit unit details.",
488
+ },
489
+ "see-unit-details": {
490
+ check: true,
491
+ description: "Allows the user to view detailed information for a unit.",
492
+ },
493
+ "delete-unit": {
494
+ check: true,
495
+ description: "Allows the user to delete/remove a unit.",
496
+ },
497
+ },
498
+ // The strings API-core's HID routes already enforce. `authorizeView` and
499
+ // `authorizeManage` on every `/api/access-management/hid` route resolve to
500
+ // core's `utils/hid-access.util.ts` lists -- this family -- so a security
501
+ // agency that cannot be granted them is refused by the server on every HID
502
+ // call. Offering them here does not open any gate; it makes the server's
503
+ // existing rule grantable.
504
+ "access-card-mgmt": {
505
+ "see-all-card": {
506
+ check: true,
507
+ description: "Allows the user to view all access cards.",
508
+ },
509
+ "see-all-qr-tagging": {
510
+ check: true,
511
+ description: "Allows the user to view QR tagging.",
512
+ },
513
+ view: {
514
+ check: true,
515
+ description:
516
+ "Allows the user to view access card management, including HID readers and access logs.",
517
+ },
518
+ "add-access-card": {
519
+ check: true,
520
+ description: "Allows the user to add a new access card to the system.",
521
+ },
522
+ "update-access-card": {
523
+ check: true,
524
+ description: "Allows the user to update access card details.",
525
+ },
526
+ "delete-access-card": {
527
+ check: true,
528
+ description:
529
+ "Allows the user to remove an access card from the system permanently.",
530
+ },
531
+ "assign-access-card": {
532
+ check: true,
533
+ description: "Allows the user to assign an access card to a person.",
534
+ },
535
+ "replace-access-card": {
536
+ check: true,
537
+ description: "Allows the user to replace a lost or damaged access card.",
538
+ },
539
+ "manage-hid": {
540
+ check: true,
541
+ description:
542
+ "Allows the user to manage HID face readers, cards and access records for the site.",
543
+ },
544
+ },
545
+ // Two resources below are checked ONLY by the iSecure365 mobile app, which
546
+ // reads the literal "<resource>:<action>" string off role.permissions[] and
547
+ // does not import layer-common. Without an entry here no role editor could
548
+ // grant them.
549
+ feedback: {
550
+ // Singular resource prefix. Accepted by the iSecure365 mobile app and by
551
+ // layer-common's DashboardMain; prefer "feedbacks:see-all-feedback".
552
+ "see-all-feedback": {
553
+ check: true,
554
+ description:
555
+ "Legacy singular spelling of the feedback view right. Grant \"Feedbacks\" instead for new roles.",
556
+ },
557
+ },
558
+ notifications: {
559
+ read: {
560
+ check: true,
561
+ description:
562
+ "Allows the user to open the notification feed on the iSecure365 mobile app.",
563
+ },
564
+ },
565
+ members: memberPermissions,
566
+ invitations: invitationPermissions,
567
+ roles: rolePermissions,
568
+ "bulletin-board-mgmt": bulletinBoardPermissions,
569
+ "site-settings": {
570
+ "manage-site-information":
571
+ siteSettingsPermissions["manage-site-information"],
572
+ "manage-anpr-camera": siteSettingsPermissions["manage-anpr-camera"],
573
+ "manage-cctv-camera": siteSettingsPermissions["manage-cctv-camera"],
574
+ "manage-delivery-companies":
575
+ siteSettingsPermissions["manage-delivery-companies"],
576
+ "manage-resident-visitors":
577
+ siteSettingsPermissions["manage-resident-visitors"],
578
+ "manage-work-order-settings":
579
+ siteSettingsPermissions["manage-work-order-settings"],
580
+ "manage-red-dot-settings": {
581
+ check: true,
582
+ description:
583
+ "Allows the user to manage red dot settings.",
584
+ },
585
+
586
+ },
587
+
588
+ };
589
+
590
+ return {
591
+ permissions,
592
+ };
593
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.2.16",
5
+ "version": "4.2.17",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",