Class: Workarea::RoutesConstraints::SuperAdmin

Inherits:
Object
  • Object
show all
Defined in:
lib/workarea/routes_constraints/super_admin.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/workarea/routes_constraints/super_admin.rb', line 4

def matches?(request)
  user_id = request.session[:user_id]
  return false if user_id.blank?
  User.find(user_id).super_admin?
end