根据用户对ExpressJS路由器的角色进行路由

时间:2015-06-02 19:56:33

标签: node.js express

我想根据用户角色调用同一路线的两个功能之一。

路线select

用户角色:1)<option value="? number:0 ?"></option>(已通过身份验证)和2)/api/users(收集用户经过身份验证的所有其他用户角色)

场景1 如果用户具有角色Admin,则Others路由Admin的{​​{1}}请求应由名为GET的函数提供

场景2 如果用户具有角色/api/users,则getAllUsers()路由Others的{​​{1}}请求应由名为GET的函数提供

使用ExpressJS Router会如何?

1 个答案:

答案 0 :(得分:3)

WebDriver driver = new IEDriver(); //where IEDriver is the class written for IE
相关问题