.net 中的访问控制列表 (ACL) 抽象层
.net 中是否有可用的 ACL 抽象层?我看过一些“最佳实践”文档,但没有良好的基础实施。 System.Security.AccessControl 怎么样?这是一个好的起点吗?
ACL 应该与存储在数据库中的角色以及系统的角色以及内存中对象定义以及数据库对象或文件一起使用。所以它应该是通用的和/或易于扩展的。
这应该依赖于 .net 框架中的 IPrincipal、IIdentity 吗?
Zend 在他们的 PHP 框架中有类似的东西,我正在为 C# 搜索这种东西,而不是移植它(如果已经有标准解决方案或最佳实践实现)。
@ladislav:
它不仅仅用于 Web 服务、胖客户端或独立应用程序。因此,我正在寻找一个可以通过特定后端/平台的适配器进行扩展的抽象层。你是对的,我正在寻找类似基于角色的访问管理抽象层之类的东西来寻找不同类型的对象和正确的定义。这不应该依赖于您为文件系统中的文件夹设置的 ACL。文件系统应该是 ACL 实现使用的特殊适配器。对我来说,ACL本身就是一个概念,与文件系统无关。文件系统使用 ACL 概念的实现(即使它在该领域最为人所知)。不需要对 Win32-api 的硬依赖。这就是为什么我要求提供一些常用(且广泛)使用的通用和抽象(接口)。你知道 zend 框架中的实现吗(我知道它是 PHP,但这个概念适用于任何应用程序,不仅仅是基于 Web 的)?它是抽象的,可用于代码中的任何对象
Is there an ACL abstraction layer available in .net? I have seen some "best practices" documents but no good base implementation. What about the System.Security.AccessControl? Is this a good starting point?
The ACL's should work with Roles stored in DB as well as Roles by the system and for in-memory-object definitions as well as db objects or files. So it should be generic and/or easy to extend.
Should this rely on IPrincipal, IIdentity from the .net framework?
Zend has something similar in their Framework for PHP and I am searching this kind of stuff for C# instead of porting that (if there is already a standard solution or best practice implementation).
@ladislav:
It is not intended to be used only in web services, fat clients or standalone apps. Because of this I am searching an abstraction layer that can be extended by adapters for a specfic backend/platform. You're right, that I am searching something like a role based access management abstraction layer for different kind of objects and right definitions. This should not rely onto the ACLs you set for folders in filesystems. A filesystem should be a special adapter used by the ACLs implementation. For me, ACL itself is a concept and has nothing to do with filesystems. Filesystems USES an implementation of the concept of ACL (even if its mostly known in this field). The hard dependency onto Win32-api is not wanted. This is why I am asking for something generic and abstract (interface) that is commonly (and widely) used. Do you know the implementation in the zend framework (I know it is PHP but the concept works for any app, not only web based)? It is abstracted and could be used for any object in the code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个示例抽象是库 nAcl - .NET 访问控制列表
功能:
...但我还没有没见过IPrincipal的用法在界面内。
An example abstraction is the library nAcl - .NET Access Control List
Features:
... but I haven't seen the usage of IPrincipal within the Interface.