@finema/finework-layer 1.0.62 → 1.0.64

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.64](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/1.0.63...1.0.64) (2026-05-25)
4
+
5
+ ### Features
6
+
7
+ * enhance hasPermission to support array-based module permissions ([869121a](https://gitlab.finema.co/finema/finework/finework-frontend-layer/commit/869121afc544939c6b578fef84b0ca82cad6d270))
8
+
9
+ ## [1.0.63](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/1.0.62...1.0.63) (2026-05-23)
10
+
11
+ ### Features
12
+
13
+ * enhance permission checks for management, finance, and people apps ([5ec9a9a](https://gitlab.finema.co/finema/finework/finework-frontend-layer/commit/5ec9a9a041c1f4957523183a7a5ad2a0e87bac49))
14
+
3
15
  ## [1.0.62](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/1.0.61...1.0.62) (2026-05-19)
4
16
 
5
17
  ### Features
@@ -56,7 +56,10 @@
56
56
  v-for="group in navigationItems"
57
57
  :key="group.label"
58
58
  >
59
- <div class="truncate px-2.5 text-xs font-bold text-gray-500">
59
+ <div
60
+ class="truncate px-2.5 text-xs font-bold text-gray-500"
61
+ :class="isCollapsed ?'text-center' : ''"
62
+ >
60
63
  {{ group.label }}
61
64
  </div>
62
65
  <Separator
@@ -355,7 +355,7 @@ const managementApps = computed(() => [
355
355
  },
356
356
  ]
357
357
  : []),
358
- ...(auth.hasPermission(UserModule.CHECKIN, Permission.ADMIN)
358
+ ...(auth.hasPermission(UserModule.CHECKIN, Permission.ADMIN, Permission.SUPER)
359
359
  ? [
360
360
  {
361
361
  name: 'clockin-admin',
@@ -385,7 +385,7 @@ const managementApps = computed(() => [
385
385
 
386
386
  const financeApps = computed(() => [
387
387
 
388
- ...(auth.hasPermission(UserModule.QUOTATION, Permission.USER, Permission.ADMIN)
388
+ ...(auth.hasPermission(UserModule.QUOTATION, Permission.USER, Permission.ADMIN, Permission.SUPER)
389
389
  ? [
390
390
  {
391
391
  name: 'Quotation',
@@ -448,7 +448,7 @@ const financeApps = computed(() => [
448
448
  ])
449
449
 
450
450
  const peopleApps = computed(() => [
451
- ...(auth.hasPermission(UserModule.EMPLOYEE, Permission.USER, Permission.ADMIN)
451
+ ...(auth.hasPermission(UserModule.EMPLOYEE, Permission.USER, Permission.ADMIN, Permission.SUPER)
452
452
  ? [
453
453
  {
454
454
  name: 'Employee',
@@ -460,7 +460,7 @@ const peopleApps = computed(() => [
460
460
  },
461
461
  ]
462
462
  : []),
463
- ...(auth.hasPermission(UserModule.NEWSLETTER, Permission.USER, Permission.ADMIN)
463
+ ...(auth.hasPermission(UserModule.NEWSLETTER, Permission.USER, Permission.ADMIN, Permission.SUPER)
464
464
  ? [
465
465
  {
466
466
  name: 'Newsletter',
@@ -473,7 +473,7 @@ const peopleApps = computed(() => [
473
473
  ]
474
474
  : []),
475
475
 
476
- ...(auth.hasPermission(UserModule.ASSET, Permission.USER, Permission.ADMIN)
476
+ ...(auth.hasPermission(UserModule.ASSET, Permission.USER, Permission.ADMIN, Permission.SUPER)
477
477
  ? [
478
478
  {
479
479
  name: 'Assets',
@@ -225,12 +225,26 @@ export const useAuth = () => {
225
225
  me.set(null)
226
226
  })
227
227
 
228
- const hasPermission = (module: UserModule, ...permission: Permission[]) => {
229
- if (!me.value?.access_level) {
228
+ const hasPermission = (module: UserModule, ...permissions: Permission[]) => {
229
+ const accessLevel = me.value?.access_level
230
+
231
+ if (!accessLevel) {
230
232
  return false
231
233
  }
232
234
 
233
- return permission.includes(me.value.access_level[module])
235
+ const modulePermission = accessLevel[module]
236
+
237
+ if (!modulePermission) {
238
+ return false
239
+ }
240
+
241
+ if (Array.isArray(modulePermission)) {
242
+ return modulePermission.some((permission) =>
243
+ permissions.includes(permission),
244
+ )
245
+ }
246
+
247
+ return permissions.includes(modulePermission)
234
248
  }
235
249
 
236
250
  const isSuperAdmin = computed(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@finema/finework-layer",
3
3
  "type": "module",
4
- "version": "1.0.62",
4
+ "version": "1.0.64",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground -o",