我应该如何在 Web 应用程序中实现 ACL?

发布于 2024-07-13 10:55:55 字数 1436 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

请爱~陌生人 2024-07-20 10:55:55

您可以查看 Spring Security(以前称为 Acegi)的文档,它是一个广泛使用的 Java ACL 框架。

该文档非常详尽,还描述了机器人身份验证和授权设计中的各种注意事项。 即使不使用 Java,它也值得一读。

您可以查看索引页面以获取概述和对 Acegi 做什么(和不做什么)的印象。 您还可以直接跳到 授权概念甚至数据库架构

You could take a look at the documentation of Spring Security (formerly Acegi), which is a widely used Java ACL framework.

The documentation is exhaustive and also describes the various considerations made in the design of bot authentication and authorization. Even without using Java it is worthy reading.

You can view the index page to get an overview and an impression of what Acegi does (and does not) do. You can also skip right to the authorization concepts or even to the database schema.

我一向站在原地 2024-07-20 10:55:55

这基本上与我在自己的网络应用程序中采用的方法相同(并且对我来说进行了一些尝试和错误)。 唯一的区别是,我可能会使用一个具有不同权限的表作为列,这样如果您想稍后添加更多权限,就可以。 使用整数中的位会将您限制为固定数量的权限,即与整数中的位数一样多。 通常情况下,我认为 32 可能就足够了,但我不喜欢这样限制自己。

就其价值而言,这也是 phpBB 使用的模型(权限作为表列),如果它对于可以说是最流行的 PHP Web 应用程序来说足够好,那么它可能对您来说足够好;-)

That's basically the same approach I take in my own web apps (and a bit of trial and error has gone into that for me). The only difference is, I'd probably use a table which has the different permissions as columns, so that if you want to add more permissions later on, you can. Using bits in an integer limits you to a fixed number of permissions, namely as many bits as there are in the integer. Typically that would be 32 which I suppose is probably enough, but I prefer not to limit myself that way.

For what it's worth, that's also the model that phpBB uses (permissions as table columns), and if it's good enough for arguably the most popular PHP web app, it's probably good enough for you ;-)

另类 2024-07-20 10:55:55

我确信您已经找到了 phpgacl,但如果您还没有找到,这里有一个链接。 一开始可能有点难以理解,而且该库在项目中实现起来确实很棘手(耗时),但文档和演示是很好的参考点。

PHP 通用访问控制列表

I'm sure you've found phpgacl already, but here's a link in case you haven't. It can be a little rough to wrap your head around at first, and certainly the library is tricky (time consuming) to implement into a project, but the documentation and demo are EXCELLENT reference points.

PHP Generic Access Control Lists

夜光 2024-07-20 10:55:55

一般来说,Web 应用程序中的 ACL 方法已经被讨论过,例如此处。

ACL approaches in web applications, in general, have been discussed, for example here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文