diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index 704f9be24..1274229b5 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -56,7 +56,7 @@ module Abilities can [:index, :create, :edit, :update, :destroy], Geozone - can [:read, :create, :update, :destroy, :add_question, :search_booths, :search_officers, :booth_assignments], Poll + can [:read, :create, :update, :destroy, :add_question, :search_booths, :search_officers, :booth_assignments, :results, :stats], Poll can [:read, :create, :update, :destroy, :available], Poll::Booth can [:search, :create, :index, :destroy], ::Poll::Officer can [:create, :destroy, :manage], ::Poll::BoothAssignment diff --git a/app/models/abilities/everyone.rb b/app/models/abilities/everyone.rb index 4d2fe4434..32f948a5a 100644 --- a/app/models/abilities/everyone.rb +++ b/app/models/abilities/everyone.rb @@ -6,7 +6,9 @@ module Abilities can [:read, :map], Debate can [:read, :map, :summary, :share], Proposal can :read, Comment - can [:read, :results, :stats], Poll + can :read, Poll + cannot :results, Poll, results_enabled: false + cannot :stats, Poll, stats_enabled: false can :read, Poll::Question can [:read, :welcome], Budget can :read, SpendingProposal diff --git a/app/views/polls/_poll_subnav.html.erb b/app/views/polls/_poll_subnav.html.erb index 8155e2ef4..371571896 100644 --- a/app/views/polls/_poll_subnav.html.erb +++ b/app/views/polls/_poll_subnav.html.erb @@ -1,29 +1,35 @@ -
-
- +
- +<% end %> diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 839b8725a..709fcc2a2 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -15,7 +15,7 @@ <% else %> - <% if current_user && @poll.voted_in_web?(current_user) %> + <% if current_user && @poll.voted_in_web?(current_user) && !@poll.expired? %>
<%= t("polls.show.already_voted_in_web") %>