diff --git a/app/models/abilities/common.rb b/app/models/abilities/common.rb index 8f289f986..d8d716ec2 100644 --- a/app/models/abilities/common.rb +++ b/app/models/abilities/common.rb @@ -94,6 +94,8 @@ module Abilities can [:create], Topic can [:update, :destroy], Topic, author_id: user.id + + can :disable_recommendations, [Debate, Proposal] end end end diff --git a/app/models/abilities/everyone.rb b/app/models/abilities/everyone.rb index afc1eeeb3..23cfdc971 100644 --- a/app/models/abilities/everyone.rb +++ b/app/models/abilities/everyone.rb @@ -29,7 +29,6 @@ module Abilities can [:read], Legislation::Question can [:read, :map, :share], Legislation::Proposal can [:search, :comments, :read, :create, :new_comment], Legislation::Annotation - can :disable_recommendations, [Debate, Proposal] end end end diff --git a/spec/models/abilities/common_spec.rb b/spec/models/abilities/common_spec.rb index f559eba99..93ffa9a48 100644 --- a/spec/models/abilities/common_spec.rb +++ b/spec/models/abilities/common_spec.rb @@ -299,4 +299,10 @@ describe Abilities::Common do it { should_not be_able_to(:answer, incoming_poll_question_from_other_geozone) } end end + + describe "#disable_recommendations" do + it { should be_able_to(:disable_recommendations, Debate) } + it { should be_able_to(:disable_recommendations, Proposal) } + end + end