[Coldbox 3.8.1] Bypass Security Interceptor

I have a quick question on how one would bypass a security interceptor when running a scheduled task since there would not be a user associated with said task?

My interceptor function looks like this:

function preProcess(event, interceptData){

var prc = event.getCollection(private=true);
var rc = event.getCollection();

//adds the user to every request
prc.oUser = securityService.getUserSession();
if(not StructIsEmpty(prc.oUser)){
prc.oNav = navigation.getNavCounts(prc.oUser.MROEntityID);
//add OUR htmlHelper to every request
prc.html = htmlHelper;

Any help is appreciated.

Thank you.


Have you looked at the eventPattern annotation?


It allows you to specify a regex that will match against incoming events and either run the interception function (for a match) or skip it (for no match)

Easy, add the scheduled route to the whitelist.