parent
041b2ea358
commit
2c143af774
@ -0,0 +1,7 @@
|
||||
class AdminConstraint
|
||||
def matches?(request)
|
||||
return false unless request.session[:user_id]
|
||||
user = User.find request.session[:user_id]
|
||||
user && user.admin?
|
||||
end
|
||||
end
|
Loading…
Reference in new issue