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.
我试图找到一种显示/隐藏动作的方法。我想让系统管理员为用户选择特定的权限。例如:读写创建发送消息转发消息等...每个页面将包含将显示或不显示的部分,取决于权限。最好的方法是什么?
@if (User.IsInRole("Admin")) { <div>Only administrators can see this message</div> }