@nitra/vite-boot 3.1.5 → 3.1.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/router.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/vite-boot",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "description": "Vite boot",
5
5
  "type": "module",
6
6
  "exports": {
package/src/router.js CHANGED
@@ -35,7 +35,12 @@ export function canUserAccess(to) {
35
35
  return false
36
36
  }
37
37
  }
38
+ // Якщо на сторінці не вказано обмеження по ролі
39
+ if (!to.meta?.roles) {
40
+ return true
41
+ }
38
42
 
43
+ // Якщо вказано - чи входить в дозволені користувачу
39
44
  if (to.meta?.roles.some(x => x === user.role)) {
40
45
  return true
41
46
  }