You could give it an API similar to on *, but with an action callback instead of the out parameter.
listener = model.before method, path, (captures..., args..., action, isLocal, passed)->
if authorised and valid
action null # attempt to perform the actual model request.
else
action "Error message" # call call the error callback of the action without attempting the perform it.
You could give it an API similar to
on *
, but with anaction
callback instead of theout
parameter.