Closed 3ynm closed 4 years ago
Define your globalRules in a file...
import Vue from 'vue'
import { AclInstaller, AclCreate, AclRule } from 'vue-acl'
import router from './router'
Vue.use(AclInstaller)
export default new AclCreate({
initial: 'public',
router,
acceptLocalRules: true,
globalRules: {
isAdmin: new AclRule('admin').generate(),
isDeveloper: new AclRule('developer').generate(),
}
})
I'm actually doing it. I want to know how to do it dynamically (after a successful remote request).
When accessing your app you want to make a GET request to obey the permissions and be able to load them in the request?
You can try
const globalRules = {};
axios.get('/available-permissions').then((response) => {
response.data.forEach((permission) => {
new AclRule(permission).generate();
});
});
Try use local rules: https://github.com/leonardovilarinho/vue-acl#use-in-components
Closed due to lack of response
I would like to do something as the following:
how could I?