Node.js 和 ACL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14235335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 16:54:29  来源:igfitidea点击:

Node.js and ACL

node.jsexpressmongooseacl

提问by otodockal

I've chosen for my project Node.js+Express+Mongoose. Until now, I didn′t need to use ACL, but in this phase of project a I need to implement this.

我为我的项目选择了Node.js+Express+Mongoose。到目前为止,我不需要使用ACL,但是在项目 a 的这个阶段我需要实现它。

NPM contains a few modules, but which one to choose?

NPM 包含几个模块,但选择哪一个?

Please tell me your experiences with ACL (Node.js+Express+Mongoose). And If you know any tutorial it would be great :), but it's not so needed, what I exactly need to know what Node.js programmers are using for ACL.

请告诉我您使用 ACL (Node.js+Express+Mongoose) 的经验。如果你知道任何教程,那就太好了:),但它并不是那么需要,我确切需要知道 Node.js 程序员使用什么来进行 ACL。

Last possibility is write own acl-middleware, it could be interesting experience for me. I suppose :)

最后一种可能是编写自己的 acl-middleware,这对我来说可能是有趣的经历。我想 :)

回答by the.ufon

https://npmjs.org/package/acl

https://npmjs.org/package/acl

The most used ACL module. It has Express middleware for protect resources and mongo support too..

最常用的ACL模块。它也有用于保护资源和 mongo 支持的 Express 中间件。

回答by Sergii Stotskyi

acl package has not been updated for the last 2 years. I'm the author of CASL - isomorphic permission management for JavaScript - https://github.com/stalniy/casl

acl 包在过去 2 年没有更新。我是 CASL 的作者 - JavaScript 的同构权限管理 - https://github.com/stalniy/casl

According to npm trends it's the mostly used library nowadays - https://www.npmtrends.com/acl-vs-@casl/ability

根据 npm 趋势,它是当今最常用的库 - https://www.npmtrends.com/acl-vs-@casl/ability

By the way it makes an integration with MongoDB and mongoose really easy!

顺便说一句,它使与 MongoDB 和 mongoose 的集成变得非常容易!