RebuildPermissionsForm.php in Drupal 8
File
core/modules/node/src/Form/RebuildPermissionsForm.php
View source
<?php
namespace Drupal\node\Form;
use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
class RebuildPermissionsForm extends ConfirmFormBase {
public function getFormId() {
return 'node_configure_rebuild_confirm';
}
public function getQuestion() {
return t('Are you sure you want to rebuild the permissions on site content?');
}
public function getCancelUrl() {
return new Url('system.status');
}
public function getConfirmText() {
return t('Rebuild permissions');
}
public function getDescription() {
return t('This action rebuilds all permissions on site content, and may be a lengthy process. This action cannot be undone.');
}
public function submitForm(array &$form, FormStateInterface $form_state) {
node_access_rebuild(TRUE);
$form_state
->setRedirectUrl($this
->getCancelUrl());
}
}