[openstreetmap/openstreetmap-website] Edit unrevoked block (PR #5104)

Anton Khorev notifications at github.com
Thu Aug 22 11:10:46 UTC 2024


@AntonKhorev commented on this pull request.



> @@ -60,7 +60,10 @@ def initialize(user)
           can [:index, :show, :resolve, :ignore, :reopen], Issue
           can :create, IssueComment
           can [:new, :create, :edit, :update, :destroy], Redaction
-          can [:new, :edit, :create, :update, :revoke, :revoke_all], UserBlock
+          can [:new, :create, :revoke, :revoke_all], UserBlock
+          can :update, UserBlock, :creator => user
+          can :update, UserBlock, :revoker => user
+          can :update, UserBlock, :active? => true

It's [OR](https://github.com/CanCanCommunity/cancancan/blob/develop/docs/combine_abilities.md) and that's what we want. Before this PR you had to be either a creator or a revoker to edit. Now additionally you can become a revoker by editing. If the block is active, it has no revoker yet. Previously you had to first revoke it, that made you a revoker, then you could edit its message. Now you can edit its message and revoke it at the same time.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5104#discussion_r1726853823
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5104/review/2254221275 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240822/0f2b055d/attachment.htm>


More information about the rails-dev mailing list