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
15 lines
345 B
Ruby
15 lines
345 B
Ruby
module Api
|
|
class UserBlocksController < ApiController
|
|
authorize_resource
|
|
|
|
before_action :set_request_formats
|
|
|
|
def show
|
|
raise OSM::APIBadUserInput, "No id was given" unless params[:id]
|
|
|
|
@user_block = UserBlock.find(params[:id])
|
|
rescue ActiveRecord::RecordNotFound
|
|
raise OSM::APINotFoundError
|
|
end
|
|
end
|
|
end
|