<p dir="auto">This PR addresses <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2323522919" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4858" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/4858/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/4858">#4858</a> by standardising on not have <code class="notranslate">:except</code> lists for the <code class="notranslate">_readable</code> checks.</p>
<p dir="auto">It also takes things one step further, by moving the before_action into the parent api_controller, and skipping that action in the only two controllers that need to skip it (and adding tests for those).</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/4859'>https://github.com/openstreetmap/openstreetmap-website/pull/4859</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/commits/91fc588556fa24b1fd1735fffacb7ec9d01ff1da" class="commit-link">91fc588</a>  Add api_status checks for user preferences API</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/commits/995bfa91ff353e60db66139fc566d88435d3723e" class="commit-link">995bfa9</a>  Remove duplicate database status checks</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/commits/f2aaec4735d70868edf7aaa60ec2b1c64194cac3" class="commit-link">f2aaec4</a>  Standardise on avoiding except lists for check_api_readable</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/commits/0bbfe922eadabac6ca753e0a6d2e2410c69eae54" class="commit-link">0bbfe92</a>  Test the versions and capabilities api in various statuses</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/commits/c1cccd40fc6af6b9790c9902581cf2e49006c084" class="commit-link">c1cccd4</a>  Move check_api_readable to api_controller</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files">19 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-7019f66f9fe72ae0512a2abecbd673f5641c10c80781ededd38a77c306905e88">app/controllers/api/capabilities_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-cbcb9ae851f89928d6366b8fbce29b38d3fb6dcc2c7ae61fdf7f3bb40911b976">app/controllers/api/changeset_comments_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-6726f8601cd22886963fb41888b55956cae4f8124aa12c701da77c3add44d94c">app/controllers/api/changesets_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-f4bef52c778c76f37c4a73b771f95886ce4c0b65e962ecc93eb76df54e6844bf">app/controllers/api/map_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-73fe5812764d31443ba0d43f028e68aa17963e92fe69d79f72957f5ac1a176b9">app/controllers/api/nodes_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-6e9fe051c0ef757618e376ffe731dfca8d4960ef0838b7d6a05609b46ba0fad1">app/controllers/api/notes_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-9ef14ff2327785a0570c617732af322ddb45c3d931599b137e90fdf411dd9fd3">app/controllers/api/old_elements_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-d76849254c4029831b9937fe42b80584a783751f4ba52e254ccaad44beca47e0">app/controllers/api/permissions_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-49b8b506dea5e046c47e71134ed6d1c4ca794559572895c26b1df469ceda868d">app/controllers/api/relations_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-19869328a2527e48402e7511953ee1aff338d652f6e8b4c40a8f4c684250ba28">app/controllers/api/tracepoints_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-e84777f55861eeb73fed3029e0429118ff087b7dd2314e398acadc4157dbaa05">app/controllers/api/traces_controller.rb</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-45532091aa0afe3e4a7089097e192ff190736fc64a59eb915df13925269bcca2">app/controllers/api/user_blocks_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-c264648051a5016bf8ab7161c8a8ac50aa4aee854789e1b327b84b0667ae1429">app/controllers/api/user_preferences_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-52cb10dc1aabfdb745ff2c590fb82ce44f6f1078750119a2b1305505475f7909">app/controllers/api/users_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-a777f00be95eb3fec01c13c2a1da5a5d39eecbda64cac574385c27a3a85cb0c6">app/controllers/api/versions_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-eb50706672183bce46654d5a373c3df75906a65a3ae5055a16ba0d8d2005ca37">app/controllers/api/ways_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-380aab66173996fadff8576f19062da8bacc45be57582f15afb9fd46c411cbbf">app/controllers/api_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-6bba4618419284e74945f52232db102b27450b8bf3a6289671a5dbb1eb20d8b5">test/controllers/api/capabilities_controller_test.rb</a>
    (70)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4859/files#diff-869059c7293e86d4785e0fb4d06bfd37d374098d02d38716d3844c0e29b69586">test/controllers/api/versions_controller_test.rb</a>
    (12)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4859.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4859.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4859.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4859.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/4859">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMHPSXNQQGVFKIHC43ZEXTW5AVCNFSM6AAAAABIPD2DGKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDGNJTGY2DIMA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOOLRYEC2ADCZLPV3TZEXTW5A5CNFSM6AAAAABIPD2DGKWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIU7S2HA.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/4859</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/4859",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4859",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>