adds abilities for SpendingProposals
This commit is contained in:
committed by
Juanjo Bazán
parent
fe32162c9f
commit
2c36ceb10c
@@ -30,4 +30,4 @@ class Moderation::UsersController < Moderation::BaseController
|
|||||||
Activity.log(current_user, :block, @user)
|
Activity.log(current_user, :block, @user)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -17,9 +17,12 @@ module Abilities
|
|||||||
proposal.editable_by?(user)
|
proposal.editable_by?(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
can :read, SpendingProposal
|
||||||
|
|
||||||
can :create, Comment
|
can :create, Comment
|
||||||
can :create, Debate
|
can :create, Debate
|
||||||
can :create, Proposal
|
can :create, Proposal
|
||||||
|
can :create, SpendingProposal
|
||||||
|
|
||||||
can [:flag, :unflag], Comment
|
can [:flag, :unflag], Comment
|
||||||
cannot [:flag, :unflag], Comment, user_id: user.id
|
cannot [:flag, :unflag], Comment, user_id: user.id
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ module Abilities
|
|||||||
can :read, Debate
|
can :read, Debate
|
||||||
can :read, Proposal
|
can :read, Proposal
|
||||||
can :read, Comment
|
can :read, Comment
|
||||||
|
can :read, SpendingProposal
|
||||||
can :read, Legislation
|
can :read, Legislation
|
||||||
can :read, User
|
can :read, User
|
||||||
can [:search, :read], Annotation
|
can [:search, :read], Annotation
|
||||||
|
|||||||
@@ -79,6 +79,4 @@
|
|||||||
<%= f.submit(class: "button radius", value: t("proposals.#{action_name}.form.submit_button")) %>
|
<%= f.submit(class: "button radius", value: t("proposals.#{action_name}.form.submit_button")) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +28,9 @@ describe "Abilities::Common" do
|
|||||||
it { should_not be_able_to(:vote, Proposal) }
|
it { should_not be_able_to(:vote, Proposal) }
|
||||||
it { should_not be_able_to(:vote_featured, Proposal) }
|
it { should_not be_able_to(:vote_featured, Proposal) }
|
||||||
|
|
||||||
|
it { should be_able_to(:index, SpendingProposal) }
|
||||||
|
it { should be_able_to(:create, SpendingProposal) }
|
||||||
|
|
||||||
it { should_not be_able_to(:comment_as_administrator, debate) }
|
it { should_not be_able_to(:comment_as_administrator, debate) }
|
||||||
it { should_not be_able_to(:comment_as_moderator, debate) }
|
it { should_not be_able_to(:comment_as_moderator, debate) }
|
||||||
it { should_not be_able_to(:comment_as_administrator, proposal) }
|
it { should_not be_able_to(:comment_as_administrator, proposal) }
|
||||||
|
|||||||
@@ -23,4 +23,7 @@ describe "Abilities::Everyone" do
|
|||||||
it { should_not be_able_to(:unflag, Proposal) }
|
it { should_not be_able_to(:unflag, Proposal) }
|
||||||
|
|
||||||
it { should be_able_to(:show, Comment) }
|
it { should be_able_to(:show, Comment) }
|
||||||
|
|
||||||
|
it { should be_able_to(:index, SpendingProposal) }
|
||||||
|
it { should_not be_able_to(:create, SpendingProposal) }
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user