Skip to content

Releases: williamcruzme/vue-gates

v2.1.2

21 Apr 06:51
Compare
Choose a tag to compare
  • Fix superRole validation
  • Improve wildcard algorithm
  • Improve types

v2.1.0

28 Sep 23:02
Compare
Choose a tag to compare
  • Vue 3 support
  • The role-or-permission directive now supports modifiers

Vue 3 support

import { createApp } from 'vue'
import VueGates from 'vue-gates'
import App from './App.vue'

createApp(App)
  .use(VueGates)
  .mount('#app')

To learn more about the Vue 3, see the official documentation.

v2.0.0

31 Aug 17:08
Compare
Choose a tag to compare
  • New name 👏: Vue Gates
  • New documentation 📄
  • Super role avoids all role and permission validations
  • Wildcards support
  • Alias now supports arguments
  • TypeScript support

Super role avoids all role and permission validations

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

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

To learn more about the configuration, see the official documentation.

Wildcards support

// Example 1:
this.$gates.setPermissions(['posts.*', 'images.create']);

// Example 2:
this.$gates.setPermissions(['posts.*.*', 'images.create']);

// Example 3:
this.$gates.setPermissions(['*.create']);

// Example 4:
this.$gates.setPermissions(['*']);

To learn more about the methods, see the official documentation.