parent
32aaaad860
commit
f0e7dd7b09
@ -1,7 +1,8 @@
|
||||
class AdminConstraint
|
||||
def matches?(request)
|
||||
return false unless request.session[:"www_user_id"]
|
||||
user = User.find request.session[:"www_user_id"]
|
||||
laboratory = Laboratory.first
|
||||
return false unless request.session[:"#{laboratory.try(:identifier).split('.').first}_user_id"]
|
||||
user = User.find request.session[:"#{laboratory.try(:identifier).split('.').first}_user_id"]
|
||||
user && user.admin?
|
||||
end
|
||||
end
|
Loading…
Reference in new issue