3 namespace Drupal\node\Form;
5 use Drupal\Core\Form\ConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 class RebuildPermissionsForm extends ConfirmFormBase {
14 public function getFormId() {
15 return 'node_configure_rebuild_confirm';
21 public function getQuestion() {
22 return t('Are you sure you want to rebuild the permissions on site content?');
28 public function getCancelUrl() {
29 return new Url('system.status');
35 public function getConfirmText() {
36 return t('Rebuild permissions');
42 public function getDescription() {
43 return t('This action rebuilds all permissions on site content, and may be a lengthy process. This action cannot be undone.');
49 public function submitForm(array &$form, FormStateInterface $form_state) {
50 node_access_rebuild(TRUE);
51 $form_state->setRedirectUrl($this->getCancelUrl());