class UserPermissionsRoleSpecificForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php \Drupal\user\Form\UserPermissionsRoleSpecificForm
- 9 core/modules/user/src/Form/UserPermissionsRoleSpecificForm.php \Drupal\user\Form\UserPermissionsRoleSpecificForm
Provides the user permissions administration form for a specific role.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\user\Form\UserPermissionsForm
- class \Drupal\user\Form\UserPermissionsRoleSpecificForm
- class \Drupal\user\Form\UserPermissionsForm
Expanded class hierarchy of UserPermissionsRoleSpecificForm
1 string reference to 'UserPermissionsRoleSpecificForm'
- user.routing.yml in core/
modules/ user/ user.routing.yml - core/modules/user/user.routing.yml
File
- core/
modules/ user/ src/ Form/ UserPermissionsRoleSpecificForm.php, line 13
Namespace
Drupal\user\FormView source
class UserPermissionsRoleSpecificForm extends UserPermissionsForm {
/**
* The specific role for this form.
*
* @var \Drupal\user\RoleInterface
*/
protected $userRole;
/**
* {@inheritdoc}
*/
protected function getRoles() {
return [
$this->userRole
->id() => $this->userRole,
];
}
/**
* Builds the user permissions administration form for a specific role.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\user\RoleInterface|null $user_role
* (optional) The user role used for this form. Defaults to NULL.
*/
public function buildForm(array $form, FormStateInterface $form_state, RoleInterface $user_role = NULL) {
$this->userRole = $user_role;
return parent::buildForm($form, $form_state);
}
}