DNN - Allow users to edit content but not settings

╄→尐↘猪︶ㄣ 提交于 2019-12-23 15:58:58

问题


I'd like "Content Managers" of my DNN website to edit just the content of a particular HTML module instance, but not its settings. How do I achieve this? If I allow this role to "Edit" the module, they are able to access and change the module settings as well. Thanks in advance for your inputs.


回答1:


This can be achieved with DotNetNuke Professional edition using the extended granular permissions.




回答2:


Or by using Oliver Hine's Enhanced Permission Provider for DotNetNuke.




回答3:


you can achive this by adding your own its called "custom permission" to a module. (I can show you how you will achive this if you are interrested) If you do this you will see in the settings of the module after the "edit" column of the permission section your custom created permission. In your code you can then check if the current logged in user has got this permission and react making grids editable or not for example.

//get the moduleconfiguration
ModuleInfo conf = this.ModuleConfiguration;
ModulePermissionCollection myPermissionCollection = ModuleConfiguration.ModulePermissions;
//read out the custom data editright of the global constant
bool bCustomEditDataRights = ModulePermissionController.HasModulePermission(myPermissionCollection, "MyCustomPermission");

Hope this helps. best regards, noone



来源:https://stackoverflow.com/questions/7827585/dnn-allow-users-to-edit-content-but-not-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!