Custom permissions for unpublished content
The code you are showing is not completely ported to Drupal 8. In particular:


hook_permission() is not used anymore from Drupal 8; what you need is describing the module permissions in view_unpub.permissions.yml
user_access() has been removed
Constants like NODE_ACCESS_ALLOW have been removed


As example of hook_node_access() implementation, see node_node_access(), which also shows what replaces user_access() in Drupal 8.

function node_node_access(NodeInterface $node, $op, $account) {
  $type = $node-&gt;bundle();
  switch ($op) {
    case 'create':
      return AccessResult::allowedIfHasPermission($account, 'create ' . $type . ' content');
    case 'update':
      if ($account-&gt;hasPermission('edit any ' . $type . ' content', $account)) {
        return AccessResult::allowed()-&gt;cachePerPermissions();
      }
      else {
        return AccessResult::allowedIf($account-&gt;hasPermission('edit own ' . $type . ' content', $account) &amp;&amp; $account-&gt;id() == $node-&gt;getOwnerId())-&gt;cachePerPermissions()-&gt;cachePerUser()-&gt;addCacheableDependency($node);
      }
    case 'delete':
      if ($account-&gt;hasPermission('delete any ' . $type . ' content', $account)) {
        return AccessResult::allowed()-&gt;cachePerPermissions();
      }
      else {
        return AccessResult::allowedIf($account-&gt;hasPermission('delete own ' . $type . ' content', $account) &amp;&amp; $account-&gt;id() == $node-&gt;getOwnerId())-&gt;cachePerPermissions()-&gt;cachePerUser()-&gt;addCacheableDependency($node);
      }
    default:

      // No opinion.
      return AccessResult::neutral();
  }


The rest of the code seems fine, to me. Check all the files you are using, and see if they need any change to make your modules work in Drupal 8.