Answer the question
In order to leave comments, you need to log in
How to properly set up casl/vue for vue?
Good afternoon.
How to install abilities correctly?
I get a list of ability strings in an array from the server, set them like this
try {
const {data} = await this.$axios.get('abilities')
this.$ability.update([
{actions: data.data, subject: 'all'}
])
}
$can('role-access')
// импортировал defineAbility
try {
const {data} = await this.$axios.get('abilities')
defineAbility((can) => {
can(data.data, 'all')
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question