2013-05-02 01:15:17 -04:00
|
|
|
require_dependency 'current_user'
|
|
|
|
|
2013-05-02 03:22:27 -04:00
|
|
|
class StaffConstraint
|
2013-05-02 01:15:17 -04:00
|
|
|
|
|
|
|
def matches?(request)
|
|
|
|
return false unless request.session[:current_user_id].present?
|
2013-05-29 13:54:23 -04:00
|
|
|
User.staff.where(id: request.session[:current_user_id].to_i).exists?
|
2013-05-02 01:15:17 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|