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:
committed by
Javi Martín
parent
b9574b3179
commit
5fa1bd8a6f
@@ -103,6 +103,8 @@ module Abilities
|
||||
can [:manage], Dashboard::AdministratorTask
|
||||
|
||||
can [:edit, :update], DownloadSetting
|
||||
|
||||
can :manage, LocalCensusRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) }
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user