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