Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通常,您可以使用有关成员资格和角色的标准 ASP.NET 基础结构。
假设您在控制器操作中检查这些,您拥有可以帮助您的 User 属性:
if (User.Identity.IsAuthenticated) { // user is logged-in }
第二个问题取决于什么样的数据。如果您在谈论权限,听起来您可能完全可以避免存储任何内容,而只需求助于角色提供程序来识别哪个用户具有哪些权限。