Open
Description
If the "can" rule returns false
, no page will be rendered ( empty page )
{
path: 'posts/:postId',
component: PostEditor,
meta: {
can: (to, from, can) => {
return axios.get(`/api/posts/${to.params.id}`)
.then((response) => can('edit-post', response.data));
},
onDeniedRoute: '/unauthorized'
}
}
This can be easy tested with the playground example here: https://github.com/victorybiz/vue-simple-acl/blob/master/playground/src/main.ts#L30
Metadata
Metadata
Assignees
Labels
No labels