Class: EgovUtils::AdminConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/egov_utils/routes/admin_constraint.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
# File 'lib/egov_utils/routes/admin_constraint.rb', line 3

def matches?(request)
  return false unless request.session[:user_id]
  user = EgovUtils::User.find request.session[:user_id]
  user && user.admin?
end