williamcruzme / vue-gates

🔒 A Vue.js & Nuxt.js plugin that allows you to use roles and permissions in your components or DOM elements, also compatible as middleware and methods.
https://williamcruzme.github.io/vue-gates/
MIT License
263 stars 31 forks source link

superRole implmentation questions #46

Open m7salam opened 3 years ago

m7salam commented 3 years ago

Hello,

Great library and seems easy but the documentation a bit lacking on explaining the setup of the superRole

If I made

import Vue from 'vue';
import VueGates from 'vue-gates';

Vue.use(VueGates, {
  superRole:true
});

then how would the library differentiate which role is what

or I can just use it as v-role="superRole" or v-permission="superRole"

this is a bit confusing to me on how to establish the flow of the superRole

would appreciate if you can help by explaining how would u implement it

thanks

Dennise89 commented 2 years ago

Correct me if I'm wrong, but the superRole should not be a boolean but a string. For example if you have a role 'superadmin' you should change it here.