1

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 .

buff
  • 331
  • 2
  • 13
  • Please state a simple example of the *when, why* thing. I think the question is currently too broad for answering it correctly. – ViRuSTriNiTy Jan 23 '18 at 08:30
  • @ViRuSTriNiTy Example i want to use the Tokenization Pattern on authentication and services . the module i want to create will get the current Token of the Authenticated user and call an external API to determine if the permission is garanted. – buff Jan 23 '18 at 08:33
  • @ViRuSTriNiTy To clarify more , what i learned , the modules will be called only if if its accessible via a controller , what i want is a module which will interact with a behavior of other modules . (Eg. Authentication is already included but i want my module to be called each time a user sign in ) – buff Jan 23 '18 at 08:45

1 Answers1

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.

ViRuSTriNiTy
  • 5,017
  • 2
  • 32
  • 58
  • Thank you for your answer ! another little question is it possible to use Themed attribute outside controllers ? – buff Jan 23 '18 at 10:58
  • Regarding the `Themed` attribute: please create a separate question for it. It's generally discouraged to discuss multiple questions at once. – ViRuSTriNiTy Jan 23 '18 at 11:05
  • thank you https://stackoverflow.com/questions/48400301/orchard-themed-attribute-outside-controllers – buff Jan 23 '18 at 11:13