Change record status: 
Project: 
Introduced in branch: 
11.4.x
Introduced in version: 
11.4.0
Description: 

#2991232: Add hasRole() method to AccountProxy and UserSession classes introduced a hasRole() method. Due to backwards compatibility concerns, it was added directly to the Drupal\Core\Session\AccountProxy and Drupal\Core\Session\UserSession classes.

This method is now defined in Drupal\Core\Session\AccountInterface, which all the relevant classes implement and which Drupal\user\UserInterface extends.

If you have code that implements AccountInterface, you may need to add a hasRole() method if you are not extending a class that already provides it.

Impacts: 
Module developers