fix manager can view

This commit is contained in:
sk821 2018-09-27 13:20:00 +08:00
parent 87682c2cf4
commit be6aa8c70e
1 changed files with 15 additions and 9 deletions

View File

@ -141,17 +141,23 @@ class RecruitmentsController < PseudoSessionController
def check_session
page = Page.where(:module => "pseudo_member").first
session = OrbitHelper.request.session
available = session[:current_pseudo_user_id].present? && !session[:current_pseudo_user_id].nil? ? true : false
if !OrbitHelper.current_user.nil?
available = OrbitHelper.current_user.is_admin?
end
if available || available == "true"
pu = PseudoUser.find(session[:current_pseudo_user_id])
enabled = RecruitProfile.where(:pseudo_member_id => pu.user_name).first.enabled
if OrbitHelper.current_user.is_admin?
available = true
enabled = true
else
available = false
enabled = false
end
else
enabled = false
session = OrbitHelper.request.session
available = session[:current_pseudo_user_id].present? && !session[:current_pseudo_user_id].nil? ? true : false
if available || available == "true"
pu = PseudoUser.find(session[:current_pseudo_user_id])
enabled = RecruitProfile.where(:pseudo_member_id => pu.user_name).first.enabled
else
enabled = false
end
end
{
"session" => available,