asp.net用户登录问题

发布于 2024-09-18 03:53:50 字数 99 浏览 3 评论 0原文

在 ASP.NET Web 表单应用程序中,我需要限制登录用户仅显示其公司的数据。这是我最顶层表的主键。如何根据用户进行设置。我想我会有另一个表,其中一些用户 ID 映射到公司 ID?

In an asp.net webform app, I need to restrict the logged in user to show data only for their company. This is a primary key of my topmost table. How to I set that based off the user. I imagine I would have another table with some user ID mapped to company ID?

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

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

发布评论

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

评论(1

逐鹿 2024-09-25 03:53:50

如果一个用户可以属于一家公司,那么通常会有一个公司表和一个用户表,后者的主键有一个公司 ID 外键列。然后,用户对象将在整个应用程序中(例如在 cookie 数据或会话数据中)拥有公司 ID,并且应用程序将相应地应用过滤规则。

If a user can be part of exactly one company, then generally there would be a table of companies and a table of users, with the latter having a company ID foreign key column to the primary key of the former. The user object would then have the company ID throughout the application (such as in the cookie data or session data) and the application would apply filtering rules accordingly.

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