Remove unneeded lines restricting permissions

In the past, users had permission to edit their own legislation
proposals. However, that changed in commit ebfa3fb01, where we replaced
the `can` method with `cannot`.

An easier way to remove this permission is to simply remove the whole
statement, since by default users don't have permissions to do anything.

We're also adding a test checking users can't edit their own legislation
proposals, since it was missing.
This commit is contained in:
Javi Martín
2021-12-30 17:19:49 +01:00
parent 5980df0b31
commit c34fc7f0b8
2 changed files with 4 additions and 3 deletions

View File

@@ -39,9 +39,6 @@ module Abilities
can [:retire_form, :retire], Proposal, author_id: user.id
can :read, Legislation::Proposal
cannot [:edit, :update], Legislation::Proposal do |proposal|
proposal.editable_by?(user)
end
can [:retire_form, :retire], Legislation::Proposal, author_id: user.id
can :create, Comment