Allow administrator users the ability to manage all LocalCensusRecords

Also check that other kind of users are not able to manage
LocalCensusRecords.
This commit is contained in:
Senén Rodero Rodríguez
2019-05-08 12:08:26 +02:00
committed by Javi Martín
parent b9574b3179
commit 5fa1bd8a6f
4 changed files with 7 additions and 0 deletions

View File

@@ -103,6 +103,8 @@ module Abilities
can [:manage], Dashboard::AdministratorTask
can [:edit, :update], DownloadSetting
can :manage, LocalCensusRecord
end
end
end

View File

@@ -95,4 +95,6 @@ describe Abilities::Administrator do
it { is_expected.to be_able_to :manage, Dashboard::AdministratorTask }
it { is_expected.to be_able_to :manage, dashboard_administrator_task }
it { should be_able_to(:manage, LocalCensusRecord) }
end

View File

@@ -95,6 +95,8 @@ describe Abilities::Common do
it { should_not be_able_to(:destroy, budget_investment_image) }
it { should_not be_able_to(:manage, Dashboard::Action) }
it { should_not be_able_to(:manage, LocalCensusRecord) }
describe "flagging content" do
it { should be_able_to(:flag, debate) }
it { should be_able_to(:unflag, debate) }

View File

@@ -27,6 +27,7 @@ describe Abilities::Everyone do
it { should be_able_to(:index, Budget) }
it { should_not be_able_to(:manage, Dashboard::Action) }
it { should_not be_able_to(:manage, LocalCensusRecord) }
context "when accessing poll results" do
let(:results_enabled) { true }