|
|
|
@ -3,6 +3,8 @@ class EcCoursesController < ApplicationController
|
|
|
|
|
layout 'base_ec'
|
|
|
|
|
before_filter :find_ec_course, :except => [:create, :get_calculation_data, :sync_all_course_data]
|
|
|
|
|
before_filter :find_year, :only => [:create, :get_calculation_data]
|
|
|
|
|
before_filter :require_login
|
|
|
|
|
before_filter :ec_auth, :except => [:sync_all_course_data]
|
|
|
|
|
skip_before_filter :verify_authenticity_token, :only => [:crud_targets, :crud_score_level, :sync_all_course_data, :search_courses,
|
|
|
|
|
:correlation_course, :delete_course]
|
|
|
|
|
|
|
|
|
@ -599,6 +601,13 @@ class EcCoursesController < ApplicationController
|
|
|
|
|
#@is_manager = @template_major || @ec_course.ec_course_users.pluck(:user_id).include?(User.current.id)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 职业认证的权限判断
|
|
|
|
|
def ec_auth
|
|
|
|
|
unless User.current.admin? || (User.current.ec_school.present? && User.current.ec_school == @ec_major_school.school_id)
|
|
|
|
|
render_403
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def target_list_data course_targets
|
|
|
|
|
targets = []
|
|
|
|
|
course_targets.each do |ct|
|
|
|
|
|