代码编辑权限

dev_cs
daiao 5 years ago
parent b169de8d8d
commit f2b036b659

@ -978,7 +978,7 @@ private
raise("实训名称不能为空") if params[:shixun][:name].blank? raise("实训名称不能为空") if params[:shixun][:name].blank?
params.require(:shixun).permit(:name, :trainee, :webssh, :can_copy, :use_scope, :vnc, :test_set_permission, params.require(:shixun).permit(:name, :trainee, :webssh, :can_copy, :use_scope, :vnc, :test_set_permission,
:task_pass, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden, :task_pass, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden,
:hide_code, :forbid_copy, :vnc_evaluate) :hide_code, :forbid_copy, :vnc_evaluate, :code_edit_permission)
end end
def shixun_info_params def shixun_info_params

@ -30,6 +30,7 @@ json.shixun do
json.scope_partment @shixun.schools.map(&:name) # 公开范围 json.scope_partment @shixun.schools.map(&:name) # 公开范围
json.opening_time @shixun.opening_time json.opening_time @shixun.opening_time
json.forbid_copy @shixun.forbid_copy json.forbid_copy @shixun.forbid_copy
json.code_edit_permission @shixun.code_edit_permission # tpi学员是否有编辑所有代码的权限
# 私密仓库 # 私密仓库
json.is_secret_repository @shixun.shixun_secret_repository.present? json.is_secret_repository @shixun.shixun_secret_repository.present?

@ -0,0 +1,6 @@
class AddCodeEditPermissionForShixun < ActiveRecord::Migration[5.2]
def change
add_column :shixuns, :code_edit_permission, :boolean, default: false
end
end
Loading…
Cancel
Save