in reply to How can I have a Dancer2 before hook return an HTTP error?

From looking at the docs (and not tested):
hook before => sub { if ($some_condition) { send_error("Not allowed", 403); } };