import { Store } from 'vuex'; import { StateInterface } from 'src/store'; export function hasPermission(permission: string, store: Store) { return store.state.user.currentPermissions.includes(permission); } export function hasPermissions(needed: string[], store: Store) { const permissions = store.state.user.currentPermissions; return needed.every(value => permissions.includes(value)); }