Make budgets result show action available only when budget is finished

This commit is contained in:
Eduardo Martinez Echevarria
2017-06-11 23:33:05 +02:00
parent 1802202033
commit 2380b97bd0
2 changed files with 2 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ module Budgets
load_and_authorize_resource :budget
def show
authorize! :read_results, @budget
@result = load_result
end

View File

@@ -17,6 +17,7 @@ module Abilities
can [:read], Budget
can [:read], Budget::Group
can [:read, :print], Budget::Investment
can :read_results, Budget, phase: "finished"
can :new, DirectMessage
can [:read, :debate, :draft_publication, :allegations, :final_version_publication], Legislation::Process
can [:read, :changes, :go_to_version], Legislation::DraftVersion