<p dir="auto">Thinking about <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4324/files#r1501833550">https://github.com/openstreetmap/openstreetmap-website/pull/4324/files#r1501833550</a>: <code class="notranslate">deny_access</code> is the ability exception handler, why not then throw the exception? Even better if cancancan throws it after making checks in <code class="notranslate">ability.rb</code>. 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 <code class="notranslate">authorize!</code> when required.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4553'>https://github.com/openstreetmap/openstreetmap-website/pull/4553</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/commits/957f139eeb9dd852e088be3d851eb2bd1dd6997b" class="commit-link">957f139</a> Add an ability to see redacted versions</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/commits/bfaa37e207650f2573b8328bd9ffbd6ad26c1258" class="commit-link">bfaa37e</a> Check for show redactions ability instead of moderator role when browsing elements</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files">8 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-debf59904131dc89a88ab44cbb1d6deaaa5a7d70c0507f674080df62f7c8e41f">app/abilities/ability.rb</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-a3926db6e853b8fb775271c951ca4789b9ba3884dfedc631bf211bd650952882">app/controllers/browse_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-856dbbd8a7c4b04da9855670a1bb69b1a5011ed845912c4097b2a79c0d1458db">app/controllers/old_nodes_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-2565415ff0cf26425751f20170047f8adeebcc125bdb9922d13cbdf7e85e8e8a">app/controllers/old_relations_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-cfe32a098ea6ffbb18196c201b634266ae4f0e0c29830fc61234fc63a56c658b">app/controllers/old_ways_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-9cad8f09be9c4a039808cca13b691a28e8e1fd099b037731be8e01a29441e644">app/views/browse/_version_actions.erb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-e0614dcafd7c43940475007116991bfcad4440c4f8cc9de90db272646dd52797">app/views/browse/feature.html.erb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553/files#diff-ebac5cdc558de785d51eae909fcca512d1ae43fd40fad2392870b95135f81311">app/views/browse/history.html.erb</a>
(2)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4553.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4553.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4553.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4553.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4553">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMTJW3UH64HCOWGVSDYWGKL5AVCNFSM6AAAAABEC6NWYOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DINZSGU2TKMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLL2UK5JHXAKYCW4EVTYWGKL5A5CNFSM6AAAAABEC6NWYOWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHICBYXGA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4553</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4553",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4553",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>