Removes permissions for admins to access unfinished budget results

This commit is contained in:
María Checa
2018-05-16 11:31:17 +02:00
committed by decabeza
parent 7053711269
commit 2dd5fe22a8
3 changed files with 54 additions and 3 deletions

View File

@@ -50,8 +50,7 @@ module Abilities
can :manage, Annotation
can [:read, :update, :valuate, :destroy, :summary], SpendingProposal
can [:index, :read, :new, :create, :update, :destroy, :calculate_winners, :read_results], Budget
can [:index, :read, :new, :create, :update, :destroy, :calculate_winners], Budget
can [:read, :create, :update, :destroy], Budget::Group
can [:read, :create, :update, :destroy], Budget::Heading
can [:hide, :update, :toggle_selection], Budget::Investment

View File

@@ -36,7 +36,7 @@
<% end %>
<% end %>
<% if @budget.finished? || (@budget.balloting? && can?(:read_results, @budget)) %>
<% if @budget.finished? %>
<%= link_to t("budgets.show.see_results"),
budget_results_path(@budget, heading_id: @budget.headings.first),
class: "button margin-top expanded" %>