We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
.NET 框架使得在应用程序中实现基于角色的安全性变得非常容易。加强安全性由两部分组成:身份验证和授权。 .NET 框架通过身份提供对用户的访问,并通过主体提供授权访问。 Thread.CurrentPrinicpal 使您可以访问分配给执行线程的当前主体。
您可以使用 IPrincipal 和 IIdentity 接口。
这里是创建 RB 安全框架的完整示例。
The .NET framework makes it very easy to implement Role-Based security in your application. Enforcing security consists of two parts, Authentication and Authorization. The .NET framework provides access to the user through an identity and authorization access through a principal. Thread.CurrentPrinicpal gives you access to the current principal assigned to the executing thread.
You can implement role based security framework easily by using IPrincipal and IIdentity interfaces.
Here is a complete example to create your RB security framework.