Extending the Content Permission Module

Topics: Customizing Orchard, Writing modules
Mar 8, 2015 at 2:54 PM
Hi, I'm a new to Orchard and I'm having problems on how to extend this module.

I only need to update the logic in the AuthorizationEventHandler class and also the shape returned by the ContentPermissionsPartDriver class or the ContentPermissionsPartViewModel.cshtml view.

I don't want to copy the whole module and then edit the specific files to fit my requirements. I believe there is a better way of doing this, similar to how templates are been overiden in Themes.

Can anyone please point me in the right direction of how to extend a module.

Thank you.
Mar 8, 2015 at 7:27 PM
You can simply write your own IAuthorizationServiceEventHandler implementation like AuthorizationEventHandler and you can change the authorization flow from there (see for Orchard event handlers: http://orcharddojo.net/orchard-resources/Library/Wiki/EventHandler). As for the shape template you can simply override it by having a ContentPermissionsPartViewModel.cshtml in you own module/theme.
Marked as answer by Facesup on 3/9/2015 at 11:12 AM
Mar 9, 2015 at 6:12 PM
Thank you