如何在 VB.net 中使用 ASP.net 4.0 将用户路由到 Web 表单页面之前检查用户角色

发布于 2025-01-03 07:17:34 字数 314 浏览 4 评论 0原文

我有一个使用 asp.net 成员身份和 URL 路由的 asp.net Web 表单应用程序。 由于角色的工作方式,我无法在每个文件夹中的 web.config 文件的允许/拒绝标签中放置“AND”或“OR”等。

这是一个商业网站,是从包含许多应用程序的 vb.net win forms 项目移植而来的。 (win forms 项目有一个自定义身份验证系统。)

Web 应用程序的结构模仿了桌面套件,并为每个应用程序创建了一个文件夹。 还有一些通用文件夹,任何应用程序的任何用户都可以在其中生成报告。

角色的结构如下

App1 被许可人

I have an asp.net web forms application that uses asp.net membership and URL Routing.
Because of the way Roles work, i cant put an "AND" or "OR", etc. in the allow/deny tags of the web.config file that resides in each folder.

This is a business website that that is being ported from a vb.net win forms project that contianed many apps. (The win forms project have a custom authentication system.)

The web app is structured in a way to mimic the desktop suites and a folder was created for each app.
There are also common folders where any user of any app can generate a report.

The roles are structured as such

App1
Licensee

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

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

发布评论

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

评论(1

您的好友蓝忘机已上羡 2025-01-10 07:17:34

简单的方法:将验证放在 global.asax 的 Application_BeginRequest 事件上。

如果需要,您可以创建一个 HttpHandler 来管理它。以下是更多信息:http://msdn.microsoft。 com/en-us/library/5c67a8bd(v=vs.71).aspx

希望有帮助。

Easy way: put that validation on your global.asax's Application_BeginRequest event.

If you want, you could create an HttpHandler for managing that. Here's more info: http://msdn.microsoft.com/en-us/library/5c67a8bd(v=vs.71).aspx

Hope it helps.

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