X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1b18f10835f5dd4a32cfeb79697f1058d9b1e383..995b43b51c6c651efe266446f6120e67d31f06ae:/services/api/app/helpers/application_helper.rb diff --git a/services/api/app/helpers/application_helper.rb b/services/api/app/helpers/application_helper.rb index 385477562d..904674bf21 100644 --- a/services/api/app/helpers/application_helper.rb +++ b/services/api/app/helpers/application_helper.rb @@ -1,25 +1,7 @@ -module ApplicationHelper - def current_user - controller.current_user - end +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 - def act_as_system_user - if not $system_user - Thread.current[:user] = User.new(is_admin: true) - sysuser_id = [Server::Application.config.uuid_prefix, - User.uuid_prefix, - '000000000000000'].join('-') - $system_user = User.where('uuid=?', sysuser_id).first - if !$system_user - $system_user = User.new(uuid: sysuser_id, - is_admin: true, - email: 'root', - first_name: 'root', - last_name: '') - $system_user.save! - $system_user.reload - end - end - Thread.current[:user] = $system_user - end +module ApplicationHelper + include CurrentApiClient end