Change the default route to the login page
[cs356-p2-videostore.git] / app / controllers / video_policy_controller.rb
index 4be73da..918c2e4 100644 (file)
@@ -1,4 +1,11 @@
 class VideoPolicyController < ApplicationController
+
+  # Make sure that a user logs in before doing any action here
+  before_filter :authorize, :only => [:index, :list, :show]
+
+  # Only managers can do the following actions
+  before_filter :manager, :only => [:new, :create, :edit, :update, :destroy]
+
   def index
     list
     render :action => 'list'