From 3d332c75d6d78b2fdf8ff266396db4881fe96f75 Mon Sep 17 00:00:00 2001 From: moshenglv Date: Thu, 31 Dec 2020 17:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5ci=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 49da04923..4a67fd413 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,6 +7,17 @@ class UsersController < ApplicationController before_action :connect_to_ci_db, only: [:get_user_info] skip_before_action :check_sign, only: [:attachment_show] + def connect_to_ci_db(options={}) + if !(current_user && !current_user.is_a?(AnonymousUser) && current_user.devops_certification?) + return + end + if current_user.ci_cloud_account.server_type == Ci::CloudAccount::SERVER_TYPE_TRUSTIE + connect_to_trustie_ci_database(options) + else + connect_to_ci_database(options) + end + end + def list scope = User.active.recent.like(params[:search]).includes(:user_extension) @total_count = scope.size