X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c9fe930b422bd1675af3adb324ede3b5aa28888c..e6f2c5ddcd8b8faba1f27cd9890fe8f24e6b72c8:/services/api/app/controllers/arvados/v1/users_controller.rb diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb index d9ab5556ff..867b9a6e6a 100644 --- a/services/api/app/controllers/arvados/v1/users_controller.rb +++ b/services/api/app/controllers/arvados/v1/users_controller.rb @@ -54,7 +54,11 @@ class Arvados::V1::UsersController < ApplicationController @object = current_user end if not @object.is_active - if not (current_user.is_admin or @object.is_invited) + if @object.uuid[0..4] == Rails.configuration.Login.LoginCluster && + @object.uuid[0..4] != Rails.configuration.ClusterID + logger.warn "Local user #{@object.uuid} called users#activate but only LoginCluster can do that" + raise ArgumentError.new "cannot activate user #{@object.uuid} here, only the #{@object.uuid[0..4]} cluster can do that" + elsif not (current_user.is_admin or @object.is_invited) logger.warn "User #{@object.uuid} called users.activate " + "but is not invited" raise ArgumentError.new "Cannot activate without being invited."