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

@ -2,8 +2,6 @@ module Api
class TracepointsController < ApiController
authorize_resource
around_action :api_call_handle_error, :api_call_timeout
# Get an XML response containing a list of tracepoints that have been uploaded
# within the specified bounding box, and in the specified page.
def index