How can I rebuild the node access permissions?

drupal node:access:rebuild returns the following error message.

[Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "node:access" namespace.

I am using Drupal Console 0.11.3 and Drupal 8.2.0-rc2.


If you're having issues with Drupal Console, you don't have access to it, or you're not using Drush, you can also do it via the UI.

  • Login as an administrator
  • Visit /admin/reports/status (also located via the menu at Reports->Status report
  • Find the Node access permissions section
  • Click on the Rebuild Permissions link (which is also located on /admin/reports/status/rebuild)
  • 1
    Worth mentioning that when doing this from the UI it can get quite a lengthy process when having a huge amount of nodes. PHP settings may need to be adjusted accordingly.
    – leymannx
    Dec 27 '18 at 23:55

With Drush:

drush php-eval 'node_access_rebuild();'

With Drupal Console:

drupal node:access:rebuild

Which is of course similar to Chamil's answer, but accessible and copy pastable :)

  • +1 for Drush, -1 for posting the exact command OP posted in their question.
    – leymannx
    Dec 27 '18 at 23:37
  • 3
    Worth mentioning that when you have quite lots of nodes you better batch the process like so: drush php-eval 'node_access_rebuild($batch_mode = TRUE)'.
    – leymannx
    Dec 27 '18 at 23:46
  • 1
    Would be useful you'd link the docs as well: node_access_rebuild()
    – leymannx
    Dec 28 '18 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.