byjove/src/plugin.js

19 lines
425 B
JavaScript
Raw Normal View History

export function ByjovePlugin(Vue) {
Vue.mixin({
methods: {
$hasPerm(name) {
// if user is root then assume permission
if (this.$store.state.user_is_root) {
return true
}
// otherwise do true perm check for user
return this.$store.state.permissions.includes(name)
},
}
})
}