Is there a way to determine within the padrino controller what the route name is? For example, in a before block, I'd like to be able to take some predetermined action based on the route. So, something like this:
before do
check_authorization_for(:route_name)
end
Where ":route_name" would be something like "update" or "delete" or "create" or whatever. As it is now, I just have the code to check whether or not the current user has permission to perform the requested action at the beginning of each controller method. Our authorization scheme relies on information in our DB, and these permissions are keyed on the controller action, so if there's a way to determine the name of the route in the controller (i.e. if I can determine that the "update" action is being called), I can just have a single block to test for authorization instead of having to do the check in each action.
I feel certain there must be a very simple way to do this, but I can't seem to find any documentation on it. Thanks in advance for the assistance.