From 6bee910e2d8dede153d4799166bb6b07ef09463a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Dec 2019 12:01:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 1816b032d..d55eb9211 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -3,7 +3,7 @@ class GamesController < ApplicationController before_action :find_game, except: [:jupyter] before_action :find_shixun, only: [:show, :answer, :rep_content, :choose_build, :game_build, :game_status] - before_action :allowed + before_action :allowed, except: [:jupyter] #require 'iconv' @@ -95,6 +95,9 @@ class GamesController < ApplicationController def jupyter # Jupyter没有challenge @myshixun = Myshixun.find_by_identifier params[:identifier] + unless current_user.id == @myshixun.user_id || current_user.admin_or_business? + raise Educoder::TipException.new(403, "..") + end @shixun = @myshixun.shixun # 判断tpm是否修改了 begin