projects
/
cs356-p2-videostore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Rental Policies and Limits
[cs356-p2-videostore.git]
/
app
/
controllers
/
application.rb
diff --git
a/app/controllers/application.rb
b/app/controllers/application.rb
index
e9da3d0
..
aaf37b3
100644
(file)
--- a/
app/controllers/application.rb
+++ b/
app/controllers/application.rb
@@
-13,4
+13,12
@@
class ApplicationController < ActionController::Base
redirect_to :controller => "login", :action => "login"
end
end
redirect_to :controller => "login", :action => "login"
end
end
+
+ def manager
+ user = User.find_by_id(session[:user_id])
+ unless user and user.manager
+ flash[:notice] = "You must be a manager to access this page"
+ redirect_to :controller => "login", :action => "index"
+ end
+ end
end
end