【发布时间】:2012-03-01 10:47:11
【问题描述】:
所以我创建了我的第一个 Orchard 模块,它本质上只是管理面板中的一个 CRUD,并带有一个可供公众使用的前端表单。现在我需要在管理面板中为不同的用户角色提供不同级别的访问权限。我已经很好地创建了“管理员”用户,但现在我遇到了权限较低的用户的问题,他们只能看到记录的子集。
问题是我不知道从哪里开始。我很乐意在我的列表屏幕上说:if (UserRole == "SomeRestrictedRole") Select.Where("however we restrict"); - 但我不知道如何访问 UserRole(我也是 .NET MVC 的新手)。
我认为正确的解决方案是扩展 IPermissions 或类似的东西?但同样,我找不到任何教程或文档来为我指明正确的方向。
这是我目前阅读的文档:
http://docs.orchardproject.net/Documentation/Creating-a-module-with-a-simple-text-editor
http://docs.orchardproject.net/Documentation/Understanding-data-access
http://docs.orchardproject.net/Documentation/Managing-users-and-roles
http://docs.orchardproject.net/Documentation/Understanding-permissions
任何建议将不胜感激!
【问题讨论】:
标签: c# asp.net permissions orchardcms