user_access gone in Drupal8, now to check permissions in Drupal 8 Do This

https://drupal.org/node/2049309

hasPermission('name of permission');
$account = user_load('3');
$account->hasPermission('name of permission');
?>