joaojosefilho/vuejsOidcClient

How to use Multiple Roles

Closed this issue · 2 comments

if I need use two or more roles in vue-roter,How to confing?

if I use role: ['Role1','Role2'],when logged user's role is Role2,It will denied access to this router。Thanks

{
      path:'/value',
      name:'value',
      component:Value,
      meta: {
        requiresAuth: true,
        role: ['Role1','Role2']
      }
    },

如何实现Role1或Role2任意一个角色的用户登陆,都可以具有访问权限,感谢

you will need to change the index.js(https://github.com/joaojosefilho/vuejsOidcClient/blob/master/src/index.js)

In line 24 of index.js, the 'to.meta.role' attribute stores the roles of the route. when there is one more role, 'to.meta.role' is going to be an array. you have to go through the array.

you will need to change the index.js(https://github.com/joaojosefilho/vuejsOidcClient/blob/master/src/index.js)

In line 24 of index.js, the 'to.meta.role' attribute stores the roles of the route. when there is one more role, 'to.meta.role' is going to be an array. you have to go through the array.

thanks,感谢,之前没理解这一块,现在已经解决