I am setting up a module (admin module in ‘modules/admin’), and want it to ignore interceptors that I have setup in the Main Application config and only have interceptors in ‘modules/admin/interceptors’ applicable to my module. Or if that is not possible, at the very least, ignore one of my Main Application interceptors.
Is anyone able to tell me if this is possible, and if so how I would go about that?
Many Thanks!
Jason
An option I have found from the docs is to use eventpattern annotation
void function preProcess(event,struct interceptData) eventPattern="^blog:"{}
This will help me achieve my objectives, but can anyone suggest how I would setup the regex to NOT run in the admin module, or to ONLY run in the main application?
Thanks again.
Jason
Found the regex I needed, but the problem I have now is that can’t get the preProcess interceptor that I have setup in my module to work,
So in my main application I have an interceptor Security.cfc (in /interceptors/Security.cfc) with a preProcess event declares with
public void function preProcess(required event, required interceptData) eventPattern="^(?!admin):"{
Then in my admin module, I have another Security.cfc (in /modules/admin/interceptors/Security.cfc) with a preProcess event declared with
public void function preProcess(required event, required interceptData) eventPattern="^admin:"{
interceptor is setup in moduleConfig.cfc with
i
`
interceptors = [
{class="#moduleMapping#.interceptors.Security"}
];
`
But admin preProcess interceptor doesn’t seem to be firing. Am I barking up the totally wrong tree with this?
Cheers
Jason
Got it working, just changed the name of the Interceptor cfc in the module to AdminSecurity.cfc and it worked fine.