|
|
|
@ -48,6 +48,19 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
EduSetting.get(name)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 平台身份权限判断(学生用户无权限)
|
|
|
|
|
def identity_auth
|
|
|
|
|
ue = current_user.user_extension
|
|
|
|
|
tip_exception(403, "..") unless current_user.admin_or_business? || ue.teacher? || ue.professional?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 平台已认证身份判断(已认证的老师和专业人士)
|
|
|
|
|
def certi_identity_auth
|
|
|
|
|
ue = current_user.user_extension
|
|
|
|
|
tip_exception(403, "..") unless current_user.admin_or_business? ||
|
|
|
|
|
(current_user.professional_certification && (ue.teacher? || ue.professional?))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def shixun_marker
|
|
|
|
|
unless current_user.is_shixun_marker? || current_user.admin_or_business?
|
|
|
|
|
tip_exception(403, "..")
|
|
|
|
@ -73,7 +86,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
check_account
|
|
|
|
|
tip_exception(@course.excellent ? 410 : 409, "您没有权限进入")
|
|
|
|
|
end
|
|
|
|
|
if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT
|
|
|
|
|
if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id
|
|
|
|
|
# 实名认证和职业认证的身份判断
|
|
|
|
|
tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication &&
|
|
|
|
|
@course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
|
|
|
|
|