Move disable recommendations permissions to Abilities::Common model
This commit is contained in:
@@ -94,6 +94,8 @@ module Abilities
|
|||||||
|
|
||||||
can [:create], Topic
|
can [:create], Topic
|
||||||
can [:update, :destroy], Topic, author_id: user.id
|
can [:update, :destroy], Topic, author_id: user.id
|
||||||
|
|
||||||
|
can :disable_recommendations, [Debate, Proposal]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ module Abilities
|
|||||||
can [:read], Legislation::Question
|
can [:read], Legislation::Question
|
||||||
can [:read, :map, :share], Legislation::Proposal
|
can [:read, :map, :share], Legislation::Proposal
|
||||||
can [:search, :comments, :read, :create, :new_comment], Legislation::Annotation
|
can [:search, :comments, :read, :create, :new_comment], Legislation::Annotation
|
||||||
can :disable_recommendations, [Debate, Proposal]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -299,4 +299,10 @@ describe Abilities::Common do
|
|||||||
it { should_not be_able_to(:answer, incoming_poll_question_from_other_geozone) }
|
it { should_not be_able_to(:answer, incoming_poll_question_from_other_geozone) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#disable_recommendations" do
|
||||||
|
it { should be_able_to(:disable_recommendations, Debate) }
|
||||||
|
it { should be_able_to(:disable_recommendations, Proposal) }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user