0👍
export default function ({ $auth }) {
const isLogin = $auth.loggedIn
const abilities = defineAbility((can) => {
if (isLogin) {
const user = $auth.user
can(user.permissions)
} else {
can([])
}
})
Vue.use(abilitiesPlugin, abilities)
}
Source:stackexchange.com