Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293174

user_access() should not depend on Drupal::request()->attributes->get('account')

$
0
0

After patch #1890878: Add modular authentication system, including Http Basic; deprecate global $user got in we introduced

  if (!isset($account)) {
    // In the installer request session is not set, so we have to fall back
    // to the global $user. In all other cases the session key is preferred.
    $account = Drupal::request()->attributes->get('account') ?: $user;
  }

This is pretty bad because if you have 'account' parameter in your route (for example /user/{account}/contact) simple user_access('some permission') won't work as expected. You would expect global user to be checked when do not mention account argument for user_access() but it will check for account in path.


Viewing all articles
Browse latest Browse all 293174

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>