[coldbox 3.8.1] Override event or view in Handlers preHandler() method

I want to run a preHandler AOP method on a handler which checks to see if user can access this handler, and if not, give them a message that they can’t.

My current handler is below… from what I can tell working through the Coldbox Docs, this should do what I am trying to do, but when I access the ‘main’ action, it is showin the main view, but I would expect the preHandler to override this and show me the noaccess view (via the noaccess method).

Can anyone see what I might be doing wrong?

Thanks

`

component output=“false” extends="_handlers"{

//Pre Handler

public function preHandler(event,action,eventArguments){

var memberDenied = true;

if (memberDenied)
event.overrideEvent(’_cpd.noaccess’);

}

//Main

public function main(event,rc,prc){

//display main page

}

//No Access

public function noaccesss(event,rc,prc){

//display no access page

}

}

`

I just tried it in a test handler and it works as expected. I put these three methods in my main.cfc handler and when I hit main.index, I it outputs “boo!” as though I’d hit main.boo.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com