summaryrefslogtreecommitdiffstats
path: root/core/modules/user/src/Form/UserPermissionsForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/user/src/Form/UserPermissionsForm.php')
-rw-r--r--core/modules/user/src/Form/UserPermissionsForm.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/modules/user/src/Form/UserPermissionsForm.php b/core/modules/user/src/Form/UserPermissionsForm.php
index c5f221f..bd4e473 100644
--- a/core/modules/user/src/Form/UserPermissionsForm.php
+++ b/core/modules/user/src/Form/UserPermissionsForm.php
@@ -139,18 +139,21 @@ class UserPermissionsForm extends FormBase {
'warning' => !empty($perm_item['restrict access']) ? $this->t('Warning: Give to trusted roles only; this permission has security implications.') : '',
);
$options[$perm] = $perm_item['title'];
- $user_permission_description = array(
- '#theme' => 'user_permission_description',
- '#permission_item' => $perm_item,
- '#hide' => $hide_descriptions,
- );
+ // Show the permission description.
+ if (!$hide_descriptions) {
+ $user_permission_description = $perm_item['description'];
+ // Append warning message.
+ if (!empty($perm_item['warning'])) {
+ $user_permission_description .= ' <em class="permission-warning">' . $perm_item['warning'] . '</em>';
+ }
+ }
$form['permissions'][$perm]['description'] = array(
'#wrapper_attributes' => array(
'class' => array('permission'),
),
'#type' => 'item',
'#markup' => $perm_item['title'],
- '#description' => drupal_render($user_permission_description),
+ '#description' => $user_permission_description,
);
$options[$perm] = '';
foreach ($role_names as $rid => $name) {