1.0.9 • Published 5 years ago

rolespermission v1.0.9

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

[license]

vue-rolesandpermissions

vue-rolesandpermissions is a wrapper for rolesandpermsission.js in vue. You can easily hnadle roles and permission in router.

Install

  • yarn install: yarn add rolespermission
  • npm install: npm install rolespermission --save

How to use

You can import the whole package in router.js.

import roles from 'rolespermission'

add the following in beforeeach router guard Use VueCookie to check authentication token

// permission list indicates the list of permission for loggedin user
// to indicates to  beforeEach router guard parameter
// userId current logged in userId
if (VueCookie.get('authToken') != null) {
    permissionFlag = roles.manageRolesPermission(to, permissionList, userId)
  }

License

This software is distributed under MIT license.