Commit 553cd19c authored by Michael Vernier's avatar Michael Vernier

Added vote and view poll permissions

parent 92f03981
class PollsController < ApplicationController
unloadable
before_filter :find_project, :authorize, :only => :index
before_filter :find_project, :authorize, :only => :vote
def index
@project = Project.find( params[ :project_id ] )
# @project = Project.find( params[ :project_id ] )
@polls = Poll.find( :all ) # @project.polls
end
......@@ -15,4 +18,11 @@ class PollsController < ApplicationController
end
redirect_to :action => 'index'
end
private
def find_project
# @project variable must be set before calling the authorize filter
@project = Project.find( params[ :project_id ] )
end
end
# English strings go here for Rails i18n
en:
# my_label: "My label"
permission_view_polls: View Polls
permission_vote_polls: Vote Polls
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment