Closed akmalhazim closed 5 years ago
Hi,
in the latest version I added the middleware
property in the plugin installation. Use it to do this.
export default new AclCreate({
initial: 'public',
notfound: '/error',
router,
acceptLocalRules: true,
globalRules: {
isAdmin: new AclRule('admin').generate(),
isPublic: new AclRule('public').or('admin').generate(),
isLogged: new AclRule('user').and('inside').generate()
},
middleware: async acl => {
await timeout(2000) // call your api
acl.change('admin')
}
})
Hi,
I need to find a way to call the $acl object in vue-router beforeEach so that I can call $acl.change in the beforeEach middleware. I'm using vue-acl 4.0.7. Please help.
Thanks !!
Kind Regards, Akmal Hazim.