ryan
03/18/2023, 2:26 PM/route-visualizer
to the URL after installing it with Commandbox CLI.
Basically, would something like this work in Router.cfc?
route(':action?').toHandler('admin')
.withCondition(function(event, rc, prc) {
return isUserInRole('admin');
});
Essentially, I am attempting to simplify the URL from `/admin/action` to `/action` only. Then, in the route, check if the user's role is 'admin' to accept the route and pass it to the Admin handler. I've never used withCondition and the limited example is not quite correct in the coldbox docs, either, but I get the gist of it.
<https://coldbox.ortusbooks.com/the-basics/routing/routing-dsl/routing-methods#routing-conditions>