在ASP windows身份验证简单的自定义角色。净? [英] Simple custom roles for windows authentication in asp. net?

查看:97
本文介绍了在ASP windows身份验证简单的自定义角色。净?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们公司的网络,在Active Directory(AD)的角色不是适当的分配给我的申请。所以,我在数据库映射创建一个简单的表在AD和他们的角色的所有用户。从字面上有在此表中,用户和角色只有两列。

At our company network, the roles in Active Directory(AD) are not appropriately assigned for my application. So I created a simple table in my database mapping all the users in the AD and their roles. There is literally only two columns in this table, user and role.

我希望借此在asp.net强大的角色管理的优势,我想用像功能[授权(角色=经理)] 。有没有使用这些自定义角色,没有设置复杂的角色和成员提供一个简单的方法?

I hope to take advantage of the powerful role management in asp.net, I want to use features like [Authorize(Roles = "Managers")]. is there a simple way to use these custom roles without setting up complicated role and membership provider?

应用背景:
SQL Server中,LINQ,asp.net的MVC

application background: sql server, linq, asp.net mvc

推荐答案

这是很容易实现自定义角色提供。基本上你将需要实现两个功能。

It is really easy to implement custom role provider. Basically you will need to implement two functions.

看文章:自定义角色提供了MVC

这篇关于在ASP windows身份验证简单的自定义角色。净?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆