/**
* Provides the user permissions administration form.
+ *
+ * @internal
*/
class UserPermissionsForm extends FormBase {
$permissions_by_provider[$permission['provider']][$permission_name] = $permission;
}
+ // Move the access content permission to the Node module if it is installed.
+ if ($this->moduleHandler->moduleExists('node')) {
+ // Insert 'access content' before the 'view own unpublished content' key
+ // in order to maintain the UI even though the permission is provided by
+ // the system module.
+ $keys = array_keys($permissions_by_provider['node']);
+ $offset = (int) array_search('view own unpublished content', $keys);
+ $permissions_by_provider['node'] = array_merge(
+ array_slice($permissions_by_provider['node'], 0, $offset),
+ ['access content' => $permissions_by_provider['system']['access content']],
+ array_slice($permissions_by_provider['node'], $offset)
+ );
+ unset($permissions_by_provider['system']['access content']);
+ }
+
foreach ($permissions_by_provider as $provider => $permissions) {
// Module name.
$form['permissions'][$provider] = [