mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-20 14:11:11 +00:00
Add latest changes from gitlab-org/security/gitlab@16-3-stable-ee
This commit is contained in:
@ -17,8 +17,15 @@ module API
|
||||
project.import_state&.relation_hard_failures(limit: 100) || []
|
||||
end
|
||||
|
||||
expose :import_error, documentation: { type: 'string', example: 'Error message' } do |project, _options|
|
||||
project.import_state&.last_error
|
||||
expose :import_error, documentation: { type: 'string', example: 'Error message' } do |project, options|
|
||||
next unless options[:current_user]
|
||||
next unless project.import_state&.last_error
|
||||
|
||||
if Ability.allowed?(options[:current_user], :read_import_error, project)
|
||||
project.import_state&.last_error
|
||||
else
|
||||
_("Ask a maintainer to check the import status for more details.")
|
||||
end
|
||||
end
|
||||
|
||||
expose :stats, documentation: { type: 'object' } do |project, _options|
|
||||
|
@ -111,7 +111,7 @@ module API
|
||||
).execute
|
||||
|
||||
if response.success?
|
||||
present(response.payload, with: Entities::ProjectImportStatus)
|
||||
present(response.payload, with: Entities::ProjectImportStatus, current_user: current_user)
|
||||
else
|
||||
render_api_error!(response.message, response.http_status)
|
||||
end
|
||||
@ -134,7 +134,7 @@ module API
|
||||
end
|
||||
route_setting :skip_authentication, true
|
||||
get ':id/import' do
|
||||
present user_project, with: Entities::ProjectImportStatus
|
||||
present user_project, with: Entities::ProjectImportStatus, current_user: current_user
|
||||
end
|
||||
|
||||
params do
|
||||
@ -182,7 +182,7 @@ module API
|
||||
).execute
|
||||
|
||||
if response.success?
|
||||
present(response.payload, with: Entities::ProjectImportStatus)
|
||||
present(response.payload, with: Entities::ProjectImportStatus, current_user: current_user)
|
||||
else
|
||||
render_api_error!(response.message, response.http_status)
|
||||
end
|
||||
@ -241,7 +241,7 @@ module API
|
||||
).execute
|
||||
|
||||
if response.success?
|
||||
present(response.payload, with: Entities::ProjectImportStatus)
|
||||
present(response.payload, with: Entities::ProjectImportStatus, current_user: current_user)
|
||||
else
|
||||
render_api_error!(response.message, response.http_status)
|
||||
end
|
||||
|
Reference in New Issue
Block a user