节点。js/Express/Passport有一个类似CanCan的Rails授权模块?

时间:2022-05-15 04:23:11

Once a user is Authenticated, I would like a way to set the restrictions on what a user can view, edit and delete. Specifically, unless they are an Admin, they can view, edit and delete ONLY files that they own. I've seen some examples with EveryAuth and Ability.js, just wondering if there is an equivalent for those using Passport.js

一旦用户通过了身份验证,我希望有一种方法来设置用户可以查看、编辑和删除的限制。具体来说,除非他们是管理员,否则他们只能查看、编辑和删除自己拥有的文件。我看过一些有各种各样的例子和能力的例子。我只是想知道对于那些使用Passport.js的人来说,是否有对应的方法

1 个解决方案

#1


6  

Might be it can help you in achieving what you want https://github.com/ForbesLindesay/connect-roles

也许它可以帮助您实现您想要的https://github.com/forbeslindesay/connect角色

#1


6  

Might be it can help you in achieving what you want https://github.com/ForbesLindesay/connect-roles

也许它可以帮助您实现您想要的https://github.com/forbeslindesay/connect角色