Module: WorkhorseAuthorization

Extended by:
ActiveSupport::Concern
Includes:
WorkhorseRequest
Included in:
Import::GitlabGroupsController, Import::GitlabProjectsController, Projects::WorkItemsController
Defined in:
app/controllers/concerns/workhorse_authorization.rb

Instance Method Summary collapse

Instance Method Details

#authorizeObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/concerns/workhorse_authorization.rb', line 12

def authorize
  set_workhorse_internal_api_content_type

  authorized = uploader_class.workhorse_authorize(
    has_length: false,
    maximum_size: maximum_size.to_i)

  render json: authorized
rescue SocketError
  render json: _("Error uploading file"), status: :internal_server_error
end