Update permissions when logging in user

This commit is contained in:
Lance Edgar 2020-02-21 12:05:40 -06:00
parent 637363909a
commit 41ccf00049

View file

@ -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() {