@7365admin1/layer-common 4.97.1-staging.543 → 4.97.1-staging.544

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.
@@ -342,6 +342,18 @@ export const PERMISSIONS = {
342
342
  // Owner answer Q10, 2026-09-11. Mirrors `start-virtual-patrol-route`.
343
343
  "start-nfc-patrol",
344
344
  ],
345
+ // Security Ops. Both strings are enforced by the server (API-core
346
+ // `SITE_VISIT_PERMISSIONS`) and read by the security mobile app's own
347
+ // catalogue, so the spelling is maintained by hand in three places and this
348
+ // is the one that makes a typo visible.
349
+ //
350
+ // `see-all-site-visits` also decides who is told about an action: a head of
351
+ // security holds it together with `site-settings:manage-geofence`. A wildcard
352
+ // deliberately does NOT qualify for that, because a wildcard says somebody
353
+ // administers this site, not that they run security at it - measured
354
+ // 2026-10-13, every wildcard holder at a live site was an org owner, a test
355
+ // account or a service provider's administrator.
356
+ "security-ops": ["start-site-visit", "see-all-site-visits"],
345
357
  // Owner answer Q9, 2026-09-11: seeing the CCTV wall. Distinct from
346
358
  // `site-settings:manage-cctv-camera`, which is camera setup.
347
359
  "cctv-mgmt": ["see-all-cctv", "view-recordings"],
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.97.1-staging.543",
5
+ "version": "4.97.1-staging.544",
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.",
@@ -56,8 +56,50 @@ export const INVENTORY_PRESETS: TPermissionPreset[] = [
56
56
  },
57
57
  ];
58
58
 
59
- /** Presets per module key; only inventory has them today. */
60
- export const PERMISSION_PRESETS: Record<string, TPermissionPreset[]> = { inventory: INVENTORY_PRESETS };
59
+ /**
60
+ * Security Ops in plain words: the two jobs the module actually has.
61
+ *
62
+ * WHY A PRESET AND NOT A NEW PERMISSION. Neither of these is a new right: both
63
+ * sets are made of strings that already exist. The preset only spares somebody
64
+ * hunting a permission tree, and that matters here because the alternative
65
+ * people reach for is a wildcard role, which is how a service provider's
66
+ * administrator ends up supervising a security site.
67
+ *
68
+ * GEOFENCING IS NOT IN EITHER SET, and cannot be: `applyPermissionPreset` is
69
+ * scoped to one resource, and `manage-geofence` belongs to `site-settings`.
70
+ * That matters because the owner's definition of a head of security
71
+ * (2026-10-13) is this permission AND geofencing, and the server reads exactly
72
+ * that pair to decide who is told when an action is raised or sent for
73
+ * verification. So the preset's description has to send the administrator to
74
+ * tick the other box, rather than quietly leaving the job half done.
75
+ *
76
+ * `start-site-visit` is deliberately NOT in the head of security set: it is the
77
+ * right to go and do a visit, and somebody who never walks a site should not
78
+ * have to hold it to be told what is happening on one. Holding it as well does
79
+ * not disqualify them.
80
+ */
81
+ export const SECURITY_OPS_PRESETS: TPermissionPreset[] = [
82
+ {
83
+ key: "officer",
84
+ label: "Security Ops officer",
85
+ description:
86
+ "Goes to the site, works through the visit checklists and checks out. Sees their own work.",
87
+ actions: ["start-site-visit"],
88
+ },
89
+ {
90
+ key: "head",
91
+ label: "Head of security",
92
+ description:
93
+ "Sees every officer's visits and actions. Also tick Manage geofencing under Site settings: that pair is what decides who is told when an action is raised or sent for verification.",
94
+ actions: ["see-all-site-visits"],
95
+ },
96
+ ];
97
+
98
+ /** Presets per module key. */
99
+ export const PERMISSION_PRESETS: Record<string, TPermissionPreset[]> = {
100
+ inventory: INVENTORY_PRESETS,
101
+ "security-ops": SECURITY_OPS_PRESETS,
102
+ };
61
103
 
62
104
  /**
63
105
  * The permission list with `resource`'s grants replaced by `preset`'s actions --
@@ -204,6 +204,16 @@ const SITE_PAGES: Record<string, TSitePage[]> = {
204
204
  robotAlert: [{ apps: ["security", "property-management", "hygiene"], page: () => "robot-management/alerts" }],
205
205
  // hygiene has its Service Providers page too since 2026-09-28
206
206
  serviceProviderInviteAnswer: [{ apps: SERVICE_APPS, page: () => "service-providers" }],
207
+ /**
208
+ * Security Ops: an action was raised, sent for verification, signed off,
209
+ * reopened, or went overdue. Lands on the Ops Review page, which is where the
210
+ * register is read.
211
+ *
212
+ * WITHOUT THIS ENTRY THE ROW IS A DEAD END. `notificationTarget` answers null
213
+ * for a kind it has no page for, so every overdue escalation ever written has
214
+ * opened nothing at all. Adding it repairs those too, not only the new alerts.
215
+ */
216
+ "security-ops": [{ apps: ["security"], page: () => "security-ops" }],
207
217
  };
208
218
  SITE_PAGES.myVisitors = SITE_PAGES.visitors;
209
219