Skip to content

Commit

Permalink
Adding auth! to feeds.
Browse files Browse the repository at this point in the history
  • Loading branch information
bamnet committed Jul 7, 2012
1 parent 676acd0 commit 6f51082
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/feeds_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class FeedsController < ApplicationController
load_and_authorize_resource :except => [:index, :show]
# GET /feeds
# GET /feeds.xml
def index
@feeds = Feed.roots
auth!

respond_to do |format|
format.html { } # index.html.erb
Expand All @@ -16,6 +16,7 @@ def index
# GET /feeds/1.xml
def show
@feed = Feed.find(params[:id])
auth!

respond_to do |format|
format.html { } # show.html.erb
Expand All @@ -28,6 +29,7 @@ def show
# GET /feeds/new.xml
def new
@feed = Feed.new
auth!

respond_to do |format|
format.html # new.html.erb
Expand All @@ -38,12 +40,14 @@ def new
# GET /feeds/1/edit
def edit
@feed = Feed.find(params[:id])
auth!
end

# POST /feeds
# POST /feeds.xml
def create
@feed = Feed.new(params[:feed])
auth!

respond_to do |format|
if @feed.save
Expand All @@ -60,6 +64,7 @@ def create
# PUT /feeds/1.xml
def update
@feed = Feed.find(params[:id])
auth!

respond_to do |format|
if @feed.update_attributes(params[:feed])
Expand All @@ -76,6 +81,7 @@ def update
# DELETE /feeds/1.xml
def destroy
@feed = Feed.find(params[:id])
auth!
@feed.destroy

respond_to do |format|
Expand Down

0 comments on commit 6f51082

Please sign in to comment.