@7365admin1/layer-common 4.2.16 → 4.2.18

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,242 @@
1
+ /**
2
+ * THE POOL MAINTENANCE ROLE CATALOGUE — the shared copy.
3
+ *
4
+ * Same reason as `useSecurityPermission` and `useLandscapingPermission` in this
5
+ * folder: it lived only in `web-app-pool-mgmt`, one copy-paste away from the
6
+ * 32-permission drift that `usePropertyPermission` actually suffered. An
7
+ * app-local composable SHADOWS a layer one silently, so this file does nothing
8
+ * until the app copy is DELETED — 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-pool-mgmt composables/usePoolMaintenancePermission.ts` at `origin/main`,
16
+ * verbatim apart from this header. Pinned by `test/shared-role-catalogues.test.mjs`.
17
+ */
18
+ export default function usePoolMaintenancePermission() {
19
+ const {
20
+ invitationPermissions,
21
+ memberPermissions,
22
+ rolePermissions,
23
+ feedbackPermissions,
24
+ workOrderPermissions,
25
+ bulletinBoardPermissions,
26
+
27
+ } = useCommonPermissions();
28
+ const permissions: TPermissions = {
29
+ members: memberPermissions,
30
+ roles: rolePermissions,
31
+ invitations: invitationPermissions,
32
+ feedbacks: feedbackPermissions,
33
+ work_orders: workOrderPermissions,
34
+ "bulletin-board": bulletinBoardPermissions,
35
+
36
+ "site-settings": {
37
+ "can-view-site-settings": {
38
+ check: true,
39
+ description: "Allows the user to view site settings.",
40
+ },
41
+ "can-manage-site-settings": {
42
+ check: true,
43
+ description: "Allows the user to manage and update site settings.",
44
+ },
45
+ },
46
+ // area management permissions
47
+ "area-mgmt": {
48
+ "see-all-areas": {
49
+ check: true,
50
+ description: "Allows the user to view the list of all areas for a site.",
51
+ },
52
+ "add-area": {
53
+ check: true,
54
+ description: "Allows the user to create/add an area to a site.",
55
+ },
56
+ "update-area": {
57
+ check: true,
58
+ description: "Allows the user to update/edit area details.",
59
+ },
60
+ "import-areas": {
61
+ check: true,
62
+ description: "Allows the user to import/upload areas via CSV/XLSX.",
63
+ },
64
+ "see-area-details": {
65
+ check: true,
66
+ description: "Allows the user to view detailed information for an area.",
67
+ },
68
+ "delete-area": {
69
+ check: true,
70
+ description: "Allows the user to delete/remove an area.",
71
+ },
72
+ },
73
+ // unit management permissions
74
+ "unit-mgmt": {
75
+ "see-all-units": {
76
+ check: true,
77
+ description: "Allows the user to view the list of all units for a site.",
78
+ },
79
+ "add-unit": {
80
+ check: true,
81
+ description: "Allows the user to create/add a unit to a site.",
82
+ },
83
+ "update-unit": {
84
+ check: true,
85
+ description: "Allows the user to update/edit unit details.",
86
+ },
87
+ "import-units": {
88
+ check: true,
89
+ description: "Allows the user to import/upload units via CSV/XLSX.",
90
+ },
91
+ "see-unit-details": {
92
+ check: true,
93
+ description: "Allows the user to view detailed information for a unit.",
94
+ },
95
+ "delete-unit": {
96
+ check: true,
97
+ description: "Allows the user to delete/remove a unit.",
98
+ },
99
+ },
100
+ // pool schedule management permissions
101
+ "pool-schedule-mgmt": {
102
+ "see-all-schedules": {
103
+ check: true,
104
+ description: "Allows the user to view the list of all pool schedules.",
105
+ },
106
+ "see-schedule-details": {
107
+ check: true,
108
+ description: "Allows the user to view detailed information for a pool schedule.",
109
+ },
110
+ "download-schedule": {
111
+ check: true,
112
+ description: "Allows the user to download pool schedule data.",
113
+ },
114
+ "manage-schedule-tasks": {
115
+ check: true,
116
+ description: "Allows the user to manage and update pool schedule tasks.",
117
+ },
118
+ "generate-checklist": {
119
+ check: true,
120
+ description: "Allows the user to generate new pool checklists.",
121
+ },
122
+ "view-history": {
123
+ check: true,
124
+ description: "Allows the user to view pool schedule history.",
125
+ },
126
+ "add-remarks": {
127
+ check: true,
128
+ description: "Allows the user to add remarks to pool tasks.",
129
+ },
130
+ },
131
+ // schedule task management permissions
132
+ "schedule-task-mgmt": {
133
+ "see-all-schedule-tasks": {
134
+ check: true,
135
+ description: "Allows the user to view the list of all schedule tasks.",
136
+ },
137
+ "add-schedule-task": {
138
+ check: true,
139
+ description: "Allows the user to create/add a new schedule task.",
140
+ },
141
+ "update-schedule-task": {
142
+ check: true,
143
+ description: "Allows the user to update/edit schedule task details.",
144
+ },
145
+ "delete-schedule-task": {
146
+ check: true,
147
+ description: "Allows the user to delete/remove a schedule task.",
148
+ },
149
+ "see-schedule-task-details": {
150
+ check: true,
151
+ description: "Allows the user to view detailed information for a schedule task.",
152
+ },
153
+ },
154
+ // attendance management permissions
155
+ "attendance-mgmt": {
156
+ "see-all-attendance": {
157
+ check: true,
158
+ description: "Allows the user to view all team members' attendance records.",
159
+ },
160
+ "see-attendance-details": {
161
+ check: true,
162
+ description: "Allows the user to view detailed information for an attendance record.",
163
+ },
164
+ "manage-attendance-settings": {
165
+ check: true,
166
+ description: "Allows the user to configure and manage attendance settings.",
167
+ },
168
+ },
169
+ // my attendance permissions
170
+ "my-attendance": {
171
+ "see-own-attendance": {
172
+ check: true,
173
+ description: "Allows the user to view their own attendance records.",
174
+ },
175
+ "check-in-out": {
176
+ check: true,
177
+ description: "Allows the user to check in and check out.",
178
+ },
179
+ },
180
+ // equipment management permissions
181
+ "supply-mgmt": {
182
+ "see-all-supplies": {
183
+ check: true,
184
+ description: "Allows the user to view the list of all equipments.",
185
+ },
186
+ "add-supply": {
187
+ check: true,
188
+ description: "Allows the user to create/add a new equipment item.",
189
+ },
190
+ "update-supply": {
191
+ check: true,
192
+ description: "Allows the user to update/edit equipment details.",
193
+ },
194
+ "delete-supply": {
195
+ check: true,
196
+ description: "Allows the user to delete/remove an equipment item.",
197
+ },
198
+ "add-stock": {
199
+ check: true,
200
+ description: "Allows the user to add stock to equipment items.",
201
+ },
202
+ "view-stock": {
203
+ check: true,
204
+ description: "Allows the user to view stock history and details.",
205
+ },
206
+ "checkout-item": {
207
+ check: true,
208
+ description: "Allows the user to checkout equipment items.",
209
+ },
210
+ },
211
+ // equipment items (checkout) management permissions
212
+ "checkout-item-mgmt": {
213
+ "see-all-checkouts": {
214
+ check: true,
215
+ description: "Allows the user to view all item checkouts.",
216
+ },
217
+ "create-checkout": {
218
+ check: true,
219
+ description: "Allows the user to create new item checkouts.",
220
+ },
221
+ "update-checkout": {
222
+ check: true,
223
+ description: "Allows the user to update/edit item checkouts.",
224
+ },
225
+ "approve-checkout": {
226
+ check: true,
227
+ description: "Allows the user to approve item checkouts.",
228
+ },
229
+ "disapprove-checkout": {
230
+ check: true,
231
+ description: "Allows the user to disapprove item checkouts.",
232
+ },
233
+ "view-checkout-details": {
234
+ check: true,
235
+ description: "Allows the user to view detailed information for item checkouts.",
236
+ },
237
+ },
238
+ };
239
+ return {
240
+ permissions,
241
+ };
242
+ }