How to determine if user X has access to operation Y on node Z How can I programatically determine whether a certain user has "view" (or any other operation) permission for a given node?

I'm trying this, but it doesn't seem to be calling the node access hooks, and it's overall pretty ugly:

$node_grant_storage = \Drupal::service('node.grant_storage');

$current_user_has_access = is_a(
  $node_grant_storage-&gt;access(
    $node,
    'view',
    \Drupal::currentUser()-&gt;getAccount()
  ),
  'Drupal\Core\Access\AccessResultAllowed'
);


Ideally I'd like something to return a boolean and not a class (I have no use for the "neutral" option here, I just want to know if a user went into the node/X page, would they get a 403 or not).
This was easier than it seemed:

$current_user_has_access = $node-&gt;access();


This function has an optional parameter where you can pass an arbitrary user account, which defaults to the logged in user (suits my purpose).