Merge pull request #1015 from consul/investment-project-show

adds permissions for everyone to see investment projects
This commit is contained in:
Juanjo Bazán
2016-03-29 16:50:42 +02:00
2 changed files with 5 additions and 43 deletions

View File

@@ -5,7 +5,6 @@ class SpendingProposalsController < ApplicationController
load_and_authorize_resource
before_action :verify_access, only: [:show]
before_filter -> { flash.now[:notice] = flash[:notice].html_safe if flash[:html_safe] && flash[:notice] }
feature_flag :spending_proposals
@@ -41,8 +40,4 @@ class SpendingProposalsController < ApplicationController
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :association_name, :terms_of_service, :captcha, :captcha_key)
end
def verify_access
raise CanCan::AccessDenied unless current_user.try(:valuator?) || current_user.try(:administrator?) || @spending_proposal.author == current_user
end
end