@hostlink/nuxt-light 1.71.0 → 1.72.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.71.0",
4
+ "version": "1.72.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -254,12 +254,19 @@ export default defineNuxtPlugin(() => {
254
254
  // Allow the page to override the required permission via definePageMeta({ permission: '...' })
255
255
  let right = to.meta.permission;
256
256
  if (!right) {
257
+ // Convert PascalCase/camelCase folder names (e.g. "EventLog") to snake_case
258
+ // so that "/EventLog/:id/view" becomes "event_log.view" instead of "eventlog.view".
259
+ const toSnakeCase = (str) =>
260
+ str
261
+ .replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2")
262
+ .replace(/([a-z0-9])([A-Z])/g, "$1_$2")
263
+ .toLowerCase();
257
264
  const segments = to.path
258
265
  .replace(/\\/+$/, "")
259
266
  .split("/")
260
267
  .filter(Boolean)
261
268
  .filter((segment) => !segment.startsWith(":") && !/^\\d+$/.test(segment))
262
- .map((segment) => segment.toLowerCase());
269
+ .map((segment) => toSnakeCase(segment));
263
270
  right = segments.join(".");
264
271
  // If the matched route (or any nested match) is an index.vue
265
272
  // leaf, treat the URL as a folder-index page and append .index.
@@ -52,7 +52,7 @@ const reset2fa = async () => {
52
52
  <l-user-userlog :id="id" />
53
53
  </l-tab>
54
54
  <l-tab name="eventlog" icon="sym_o_description" :label="$t('Event log')"
55
- v-if="$light.isGranted('eventlog.list')">
55
+ v-if="$light.isGranted('event_log.list')">
56
56
  <l-user-eventlog :id="id" />
57
57
  </l-tab>
58
58
  </l-tabs>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.71.0",
3
+ "version": "1.72.0",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",