I'm looking for the most efficient way to detect if the current user has Edit rights on one of the module on the page. I now used
DotNetNuke.Security.Permissions.ModulePermissionController.CanEditModuleContent()
But that would mean I would have to first get all modules on the page and check this for each module, which does not feel very efficient as DNN must be doing the same check for the Persona Bar. Is there a more efficient way to check this that I missed?
Looks like the control panel is also looping over all modules on the page: https://github.com/dnnsof...nelBase.cs#L124-L163
Posted By Brian Dukes on 18 Jun 2021 09:46 AM Looks like the control panel is also looping over all modules on the page: https://github.com/dnnsof...nelBase.cs#L124-L163
Hmm, right.. thanks :-)
Posted By Sebastian Leupold on 18 Jun 2021 09:48 AM an alternative with better performance would be creating an appropriate stored procedure, you may query.
As I think the Module Settings are cached, so I guess it should not be that slow, it's just that the PB does the same check..
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.