[openstreetmap/openstreetmap-website] Add oauth scope for redactions (PR #4387)

Anton Khorev notifications at github.com
Tue Dec 5 22:38:51 UTC 2023


@AntonKhorev commented on this pull request.



> @@ -31,10 +31,10 @@ def initialize(token)
         if user.moderator?
           can [:destroy, :restore], ChangesetComment if scope?(token, :write_api)
           can :destroy, Note if scope?(token, :write_notes)
-          if user&.terms_agreed?
-            can :redact, OldNode if scope?(token, :write_api)
-            can :redact, OldWay if scope?(token, :write_api)
-            can :redact, OldRelation if scope?(token, :write_api)
+          if user&.terms_agreed? && (scope?(token, :write_api) || scope?(token, :write_redactions))
+            can :redact, OldNode
+            can :redact, OldWay
+            can :redact, OldRelation

You have rubocop checking the number and complexity of conditions. What you'd prefer is going  to cause warnings.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4387/review/1766238496 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231205/4b85e070/attachment-0001.htm>


More information about the rails-dev mailing list