[openstreetmap/openstreetmap-website] Add an ability to see redacted versions (PR #4553)

Anton Khorev notifications at github.com
Sat Mar 2 09:17:50 UTC 2024


Thinking about https://github.com/openstreetmap/openstreetmap-website/pull/4324/files#r1501833550: `deny_access` is the ability exception handler, why not then throw the exception? Even better if cancancan throws it after making checks in `ability.rb`. The problem is, the ability to see redacted versions doesn't correspond to any controller method. But we can define this ability anyway and tell cancancan to check it with `authorize!` when required.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4553

-- Commit Summary --

  * Add an ability to see redacted versions
  * Check for show redactions ability instead of moderator role when browsing elements

-- File Changes --

    M app/abilities/ability.rb (1)
    M app/controllers/browse_controller.rb (8)
    M app/controllers/old_nodes_controller.rb (8)
    M app/controllers/old_relations_controller.rb (8)
    M app/controllers/old_ways_controller.rb (8)
    M app/views/browse/_version_actions.erb (2)
    M app/views/browse/feature.html.erb (2)
    M app/views/browse/history.html.erb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4553.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4553.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/4553 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240302/6031956c/attachment.htm>


More information about the rails-dev mailing list