Move api error handling and timeouts to parent class

Fixes #4861

Since the around_action is defined before authorize_resource is called,
the handler needs to pass on the CanCan::AccessDenied exception.

I've added the timeouts where I think they were missing (e.g. UserPreferencesController)
but I've kept the exception for changeset#upload and traces#create
This commit is contained in:
Andy Allan 2024-10-02 16:37:32 +01:00
parent e8da505518
commit 83425edd8d
18 changed files with 6 additions and 27 deletions

View file

@ -7,7 +7,7 @@ module Api
authorize_resource
before_action :offline_error, :only => [:create, :destroy, :data]
around_action :api_call_handle_error
skip_around_action :api_call_timeout, :only => :create
def show
@trace = Trace.visible.find(params[:id])