限制对 ASP.NET 应用程序中 AD 角色的访问

发布于 2024-11-07 03:11:08 字数 377 浏览 0 评论 0原文

我对 ASP.net 开发相当陌生,并且想知道如何继续解决某个问题。我可以访问一个现有网站,该网站使用单个网页来显示多个不同的报告(要显示的报告类型由查询字符串确定)。条目default.aspx 页面上显示了一组指向不同报告的链接。该网站由域中的用户在内部访问,其凭据存储在 Active Directory 用户存储中。

我被要求升级该网站的安全性,以便不同的用户将根据其 AD 角色看到不同的报告列表。据我所知,安全调整可以与站点地图提供程序结合使用,以限制不同用户或角色在 ASP 菜单控件中可以访问的内容。是否可以使用别名 URL 之类的安全调整,其中别名引用带有查询字符串的报告页面?

任何其他直接实现此目的的方法(最好是在单个位置将角色映射到报告)都可以。

感谢您的帮助。 诺曼

I'm fairly new to ASP.net development, and am wondering how to continue with a certain problem. I have access to an existing website that uses a single web page to display multiple different reports (the type of report to be displayed determined by a query string). A set of links to different reports is shown on the entry default.aspx page. This web site is accessed internally by users on a domain with their credentials stored in an Active Directory user store.

I have been asked to upgrade the security of this web site so that different users will be presented with a different list of reports dependent on their AD role. I understand security trimming can be used in conjunction with a sitemap provider to restrict what different users or roles have access to in an ASP menu control. Is it possible to use security trimming with something like aliased URL's, where the alias refers to the report page with the query string?

Any other straight-forward way of achieving this (preferably with the mapping of roles to reports in a single location) is fine.

Thanks for your help.
Norman

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

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

发布评论

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

评论(2

一个人的夜不怕黑 2024-11-14 03:11:08

Typically, you can check if user belongs to certain role using one of WindowsPrincipal.IsInRole overload. What you need to do is to associate roles with reports in some configurable store (for example, database, xml file etc) and then use this information to decide if particular report is applicable to logged in user and then control visibility of the report link.

情释 2024-11-14 03:11:08

1-首先,您需要从 web.config 文件中将身份验证模式更改为 Windows 身份验证。

2-其次使用工具箱登录部分中的 LoginView 控件

3-在 LoginView 控件中选择编辑角色组链接

4-开始添加与 AD 角色同名的角色

5-将角色添加到 loginView 后,您可以从 loginView 访问它们

6- 选择 LoginView 的智能标记,视图列表指向特定角色

7- 在步骤 6 中开始添加指向所选角色的登录视图的链接

8- 为该角色中的每个角色重复步骤 7角色列表

================================================== ==========

注意:此解决方案适用于 Windows 角色(即,角色数量恒定且角色变化最小)

1-Firstly You need to change authentication mode to Windows authentication from within your web.config File.

2-Secondly Use LoginView Control from your ToolBox Login Section

3- in your LoginView Control Select Edit RoleGroups Link

4- Start Adding The Roles with the same name as your AD Roles

5- after finished adding Roles to loginView you can access them from the loginView

6- Select LoginView's smart tag and views list point to a specific Role

7- Start add links to the login View for the selected Role on step number 6

8- Repeat Step 7 for each Role in the Roles List

==========================================================

Note : this solution will be fine for windows Roles (i.e) Number of Roles are constant and changes in roles are minimum

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