Update permissions when logging in user
This commit is contained in:
parent
637363909a
commit
41ccf00049
|
@ -3,13 +3,18 @@ export function ByjovePlugin(Vue) {
|
|||
Vue.mixin({
|
||||
methods: {
|
||||
|
||||
$loginUser(user) {
|
||||
$loginUser(user, permissions) {
|
||||
|
||||
// put user info in app store
|
||||
this.$store.commit('SET_USER', user)
|
||||
this.$store.commit('SET_USER_IS_ADMIN', user.is_admin)
|
||||
// note, this should already be false
|
||||
// this.$store.commit('SET_USER_IS_ROOT', false)
|
||||
|
||||
// maybe update permissions
|
||||
if (permissions !== undefined) {
|
||||
this.$store.commit('SET_PERMISSIONS', permissions)
|
||||
}
|
||||
},
|
||||
|
||||
$logoutUser() {
|
||||
|
|
Loading…
Reference in a new issue