// Fetch permissions for the roles.
$role_permissions[$role_name] =
$role->
getPermissions();
$admin_roles[$role_name] =
$role->
isAdmin();
} // Store $role_names for use when saving the data.
$form['role_names'
] =
[ '#type' => 'value',
'#value' =>
$role_names,
];
// Render role/permission overview:
$hide_descriptions =
system_admin_compact_mode();
$form['system_compact_link'
] =
[ '#id' => FALSE,
'#type' => 'system_compact_link',
];
$form['permissions'
] =
[ '#type' => 'table',
'#header' =>
[$this->
t('Permission'
)],
'#id' => 'permissions',
'#attributes' =>
['class' =>
['permissions', 'js-permissions'
]],