fix manager can view
This commit is contained in:
parent
87682c2cf4
commit
be6aa8c70e
|
@ -141,18 +141,24 @@ class RecruitmentsController < PseudoSessionController
|
|||
|
||||
def check_session
|
||||
page = Page.where(:module => "pseudo_member").first
|
||||
if !OrbitHelper.current_user.nil?
|
||||
if OrbitHelper.current_user.is_admin?
|
||||
available = true
|
||||
enabled = true
|
||||
else
|
||||
available = false
|
||||
enabled = false
|
||||
end
|
||||
else
|
||||
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
|
||||
else
|
||||
enabled = false
|
||||
end
|
||||
end
|
||||
{
|
||||
"session" => available,
|
||||
"enabled" => enabled,
|
||||
|
|
Loading…
Reference in New Issue