rolespermission
v1.0.9
Published
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)] # vue-rolesandpermissions
Downloads
4
Maintainers
Readme
[]
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.