Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

The user_access() method was directly replaced by AccountInterface::hasPermission(). Most of the time, this account is the current user session, which can be accessed via the account attribute on the current request.

If you have a user entity, you can also use the same method.

Drupal 7

<?php
user_access
('name of permission');
$account = user_load('3');
user_access('name of permission', $account);
?>

Drupal 8

<?php
\Drupal::currentUser()->hasPermission('name of permission');
$account = user_load('3');
$account->hasPermission('name of permission');
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done