Creating a module which handle other modules

醉酒当歌 提交于 2019-12-11 13:44:07

问题


I just got involved in Orchard, so I apologize for any confusing terms. from what I learned and read you can pretty much customize Orchard to include or exclude anything you want since its a framework in the first place, so features like MVC, modules are really parts of the framework but not it's not essentially based on.

is it possible to create a module which interacts with other modules?

To make it clear, say we have a module which does something like an API call, fetching data and displaying it to the user Only. how can I create a module that will control this module behavior (when, why)? what is meant by When, Why this module will only control when this module should be executed and if not **why **.

this can be implemented on the module itself, but say we have a lot of module with pretty much the same thing .to follow the DRY we will certainly need to separate controlling this module in a separate module.

Thank you in advance!

EDIT: its like building an httpmodule which will catch all requests then decide which one pass through .


回答1:


According to your post on GitHub you can implement IAuthorizationServiceEventHandler and in that implementation you can call your external API to check for a specific permission.

I've done this myself in the past to check for fine grained permissions that were configured / stored in a separate DB.



来源:https://stackoverflow.com/questions/48392157/creating-a-module-which-handle-other-modules

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