|
|
|
@ -2,8 +2,9 @@ class ShixunsController < ApplicationController
|
|
|
|
|
before_action :require_login, except: [:download_file, :index, :menus]
|
|
|
|
|
before_action :check_auth, except: [:download_file, :index]
|
|
|
|
|
|
|
|
|
|
before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns, :propaedeutics,
|
|
|
|
|
:departments, :apply_shixun_mirror, :get_mirror_script, :download_file]
|
|
|
|
|
before_action :find_shixun, :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
|
|
|
|
|
:propaedeutics, :departments, :apply_shixun_mirror,
|
|
|
|
|
:get_mirror_script, :download_file]
|
|
|
|
|
before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy]
|
|
|
|
|
|
|
|
|
|
before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish,
|
|
|
|
@ -726,10 +727,6 @@ private
|
|
|
|
|
normal_status(404, "...")
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if !current_user.shixun_permission(@shixun)
|
|
|
|
|
tip_exception(403, "..")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def find_repo_name
|
|
|
|
|