[openstreetmap/openstreetmap-website] Add oauth scope for redactions (PR #4387)
Anton Khorev
notifications at github.com
Thu Dec 21 14:33:45 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
Did this and increased RuboCop complexity limits.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4387#discussion_r1434150981
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4387/review/1793091261 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231221/14d6903e/attachment.htm>
More information about the rails-dev
mailing list