因此,我创建了我的第一个果园模块,它基本上只是管理面板中的一个CRUD,并且可以向公众提供前端形式。现在我需要在管理面板中对不同的用户角色进行不同级别的访问。我已经创建了“管理员”用户,但现在我遇到了较少权限的用户,他们只能查看记录的子集。自定义模块中的果园权限
问题是我没有想法从哪里开始。我很乐意在我的列表屏幕上说:if (UserRole == "SomeRestrictedRole") Select.Where("however we restrict");
- 但我不知道如何访问UserRole(我也是.NET MVC的新手)。
我认为PROPER的解决方案是扩展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
任何建议,将不胜感激!
谢谢,我使用的是乌节的二进制版本。加载源代码并且你是对的,复制现有的Permissions.cs然后使用Authorizer.Authorize – captainclam 2012-02-09 02:13:33