Rename methods provided by plugin

This commit is contained in:
Lance Edgar 2022-08-11 00:17:10 -05:00
parent dee27b51f5
commit 4189bdf919

View file

@ -3,7 +3,7 @@ export function ByjovePlugin(Vue) {
Vue.mixin({ Vue.mixin({
methods: { methods: {
$loginUser(user, permissions) { $byjoveLoginUser(user, permissions) {
// put user info in app store // put user info in app store
this.$store.commit('SET_USER', user) this.$store.commit('SET_USER', user)
@ -17,7 +17,12 @@ export function ByjovePlugin(Vue) {
} }
}, },
$logoutUser() { // TODO: deprecate / remove
$loginUser(user, permission) {
this.$byjoveLoginUser(user, permission)
},
$byjoveLogoutUser() {
// remove user info from app store // remove user info from app store
this.$store.commit('SET_USER', null) this.$store.commit('SET_USER', null)
@ -25,7 +30,12 @@ export function ByjovePlugin(Vue) {
this.$store.commit('SET_USER_IS_ROOT', false) this.$store.commit('SET_USER_IS_ROOT', false)
}, },
$hasPerm(name) { // TODO: deprecate / remove
$logoutUser() {
this.$byjoveLogoutUser()
},
$byjoveHasPerm(name) {
// if user is root then assume permission // if user is root then assume permission
if (this.$store.state.user_is_root) { if (this.$store.state.user_is_root) {
@ -35,6 +45,11 @@ export function ByjovePlugin(Vue) {
// otherwise do true perm check for user // otherwise do true perm check for user
return this.$store.state.permissions.includes(name) return this.$store.state.permissions.includes(name)
}, },
// TODO: deprecate / remove
$hasPerm(name) {
return this.$byjoveHasPerm(name)
},
} }
}) })