Add user_is_admin flag to app store, plus logic to set/clear it

This commit is contained in:
Lance Edgar 2020-02-11 13:33:54 -06:00
parent a80a42fb56
commit 3c4e9567a9
4 changed files with 24 additions and 2 deletions

View file

@ -43,6 +43,7 @@ export default {
// let all of app know who the user is(n't)
this.$store.commit('SET_USER', response.data.user)
this.$store.commit('SET_USER_IS_ADMIN', response.data.user ? response.data.user.is_admin : false)
this.$store.commit('SET_USER_IS_ROOT', response.data.user ? response.data.user.is_root : false)
// also keep track of user's permissions