@afeefa/vue-app 0.0.107 → 0.0.108

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.107
1
+ 0.0.108
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.107",
3
+ "version": "0.0.108",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -2,6 +2,7 @@ import './config/event-bus'
2
2
  import './config/components'
3
3
  import './directives'
4
4
 
5
+ import { hasRightsPlugin } from '@a-admin/plugins/translation/HasRightsPlugin'
5
6
  import { translationPlugin } from '@a-admin/plugins/translation/TranslationPlugin'
6
7
  import { apiResourcesPlugin } from '@a-vue/plugins/api-resources/ApiResourcesPlugin'
7
8
  import { hasOptionsPlugin } from '@a-vue/plugins/has-options/HasOptionsPlugin'
@@ -44,6 +45,8 @@ export async function bootstrap ({ apis, models, routing, authService, getTransl
44
45
  }
45
46
 
46
47
  if (authService) {
48
+ Vue.use(hasRightsPlugin)
49
+
47
50
  authService.initApp(router)
48
51
  }
49
52
 
@@ -0,0 +1,15 @@
1
+ import { authService } from '@k-vue/auth/AuthService'
2
+
3
+ class HasRightsPlugin {
4
+ install (Vue) {
5
+ Vue.mixin({
6
+ created () {
7
+ this.$hasRight = name => {
8
+ return authService.currentAccountHasRight(name)
9
+ }
10
+ }
11
+ })
12
+ }
13
+ }
14
+
15
+ export const hasRightsPlugin = new HasRightsPlugin()