diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index a127089..84408b8 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -168,18 +168,14 @@ function filter_permission() { 'restrict access' => TRUE, ); - // @todo During installation, hook_permission() is called too early to use the - // current implementation of Drupal::currentUser(). - $account = Drupal::getContainer()->isScopeActive('request') ? Drupal::currentUser() : $GLOBALS['user']; // Generate permissions for each text format. Warn the administrator that any // of them are potentially unsafe. - $administer_filters = $account->hasPermission('administer filters'); foreach (filter_formats() as $format) { $permission = $format->getPermissionName(); if (!empty($permission)) { // Only link to the text format configuration page if the user who is // viewing this will have access to that page. - $format_name_replacement = $administer_filters ? l($format->label(), 'admin/config/content/formats/manage/' . $format->id()) : String::placeholder($format->label()); + $format_name_replacement = l($format->label(), 'admin/config/content/formats/manage/' . $format->id()); $perms[$permission] = array( 'title' => t("Use the !text_format text format", array('!text_format' => $format_name_replacement,)), 'description' => String::placeholder(t('Warning: This permission may have security implications depending on how the text format is configured.')),