还原代码

dev_aliyun2
daiao 5 years ago committed by harry
parent 5605d3db10
commit ec42fdd5e4

@ -70,14 +70,17 @@ class ApplicationController < ActionController::Base
# 实训的访问权限
def shixun_access_allowed
if !current_user.shixun_permission(@shixun)
if @shixun.user_scope == 1
school_id = @shixun.shixun_schools.first&.school_id
name = School.find_by(id: school_id)&.name
tip_exception(-5, "当前实训只对#{name}等单位开放")
else
tip_exception(403, "..")
end
tip_exception(403, "..")
end
# if !current_user.shixun_permission(@shixun)
# if @shixun.user_scope == 1
# school_id = @shixun.shixun_schools.first&.school_id
# name = School.find_by(id: school_id)&.name
# tip_exception(-5, "当前实训只对#{name}等单位开放")
# else
# tip_exception(403, "..")
# end
# end
end
def admin_or_business?

Loading…
Cancel
Save