stalniy/casl-vue-api-example

ability getter not working

Closed this issue · 3 comments

ability.update(mutation.payload.rules)

This line up here seems not working or I might be expecting something wrong. This supposed to update what? this is right after createSession is committed? seems that the ability var here is native only to that instance of the code. and I am not seeing results when I check $vm0.$ability in the console or even from vue dev tool.

I for now export ability var and assign it to the abilitiesPlugin like what you did here https://medium.com/dailyjs/casl-and-cancan-permissions-sharing-between-ui-and-api-5f1fa8b4bec. So it seems conflicting on your medium article and the actual code in the repo

Hello,

The code was a bit changed from is in the article in order to support use cases for my JSFest presentation. In the linked article ability var is imported from the module but now it's defined in the Vuex store getter here -

Hi @stalniy ,
I've followed everything from the above repo and the getter seems not working? as far as my understanding the getter will only instantiate an instance of Ability and is not event connected to the ability variable here

ability.update(mutation.payload.rules)