leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.12k stars 247 forks source link

Except One Action from a Before Filter? #747

Closed cycomachead closed 1 year ago

cycomachead commented 2 years ago

Is there a standard way to have a filter which runs on all actions except one or two? For example, I might want to have one route which skips some permissions checks, but virtually all others should have them.

yuanguangjian commented 2 years ago

u can do it with path or params in the filter

leafo commented 2 years ago

You would have to provide this functionality yourself. A potential solution would be to use self.route_name to return early in your before filter