我们正在考虑将我们的(相当重要的)Intranet 应用程序从 WebForms 迁移到 MVC。
Intranet应用程序当前使用Windows身份验证。对特定文件夹的授权由每个文件夹内的 web.config 文件控制。该应用程序还使用菜单控件来获取所有这些内容,并仅向用户显示指向他们有权查看的页面的菜单链接。所有这些功能都是 WebForms 开箱即用的。
就向 MVC 的转换而言,我认为替换此功能将是关键挑战之一。
谁能告诉我 MVC 中有哪些工具可以用来:
- 限制用户对某些内容的访问
页面/视图任何基于
他们的 Active Directory 组
会员资格
- 生成标记
了解用户的菜单
某些页面的授权/
意见
这会有很大帮助。
We're considering making the move from WebForms to MVC for our (quite substantial) intranet application.
The intranet app currently uses Windows authentication. Authorization to particular folders is controlled by web.config files inside each folder. The app also uses a Menu control which picks all this up and only shows users menu links to pages they are authorised to view. All this functionality comes out of the box with WebForms.
In terms of the conversion to MVC, I think that replacing this functionality is going to be one of the key challenges.
Can anyone tell me what tools are available in MVC to:
- restrict users' access to certain
pages / views whatever based on
their Active Directory group
membership
- generate markup for a
menu which is aware of the users'
authorisation to certain pages /
views
That would be mighty helpful.
发布评论
评论(2)
[Authorize]
属性。根据您的具体要求,您可以构建自定义 HTML 帮助器。您还可以查看 MVCContrib MenuBuilder。
Decorating the controller action with the
[Authorize]
attribute.Depending on your exact requirements you could build a custom HTML helper. You may also take a look at MVCContrib MenuBuilder.
这是一个由两部分组成的博客,我在其中解释了如何实现这一目标。
http://blogs.msdn.com/b/sajoshi/archive/2010/06/01/user-authentication-against-ad-and-roles-based-authorization -in-asp-net-mvc-part-i.aspx
http://blogs.msdn.com/b/sajoshi/archive/2010/06 /01/user-authentication-against-ad-and-roles-based-authorization-in-asp-net-mvc-part-ii.aspx
如果您需要具体详细信息,请告诉我。
This is a 2 part blog where I explained how to achieve this.
http://blogs.msdn.com/b/sajoshi/archive/2010/06/01/user-authentication-against-ad-and-roles-based-authorization-in-asp-net-mvc-part-i.aspx
http://blogs.msdn.com/b/sajoshi/archive/2010/06/01/user-authentication-against-ad-and-roles-based-authorization-in-asp-net-mvc-part-ii.aspx
Let me know if you need specific details..