@afeefa/vue-app 0.0.107 → 0.0.108
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.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.108
|
package/package.json
CHANGED
package/src-admin/bootstrap.js
CHANGED
@@ -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()
|