diff --git a/core/modules/action/action.permissions.yml b/core/modules/action/action.permissions.yml
index 0f00dcd..2b734a3 100644
--- a/core/modules/action/action.permissions.yml
+++ b/core/modules/action/action.permissions.yml
@@ -1,2 +1,2 @@
-administer actions:
+administer_actions:
   title: 'Administer actions'
diff --git a/core/modules/action/action.routing.yml b/core/modules/action/action.routing.yml
index c75ff23..2572a6a 100644
--- a/core/modules/action/action.routing.yml
+++ b/core/modules/action/action.routing.yml
@@ -4,7 +4,7 @@ action.admin:
     _title: 'Actions'
     _entity_list: 'action'
   requirements:
-    _permission: 'administer actions'
+    _permission: 'administer_actions'
 
 action.admin_add:
   path: '/admin/config/system/actions/add/{action_id}'
@@ -12,7 +12,7 @@ action.admin_add:
     _entity_form: 'action.add'
     _title: 'Add'
   requirements:
-    _permission: 'administer actions'
+    _permission: 'administer_actions'
 
 entity.action.edit_form:
   path: '/admin/config/system/actions/configure/{action}'
@@ -20,7 +20,7 @@ entity.action.edit_form:
     _entity_form: 'action.edit'
     _title: 'Edit'
   requirements:
-    _permission: 'administer actions'
+    _permission: 'administer_actions'
 
 entity.action.delete_form:
   path: '/admin/config/system/actions/configure/{action}/delete'
@@ -28,5 +28,5 @@ entity.action.delete_form:
     _entity_form: 'action.delete'
     _title: 'Delete'
   requirements:
-    _permission: 'administer actions'
+    _permission: 'administer_actions'
 
diff --git a/core/modules/action/src/Tests/ConfigurationTest.php b/core/modules/action/src/Tests/ConfigurationTest.php
index 42da0a6..60b53d8 100644
--- a/core/modules/action/src/Tests/ConfigurationTest.php
+++ b/core/modules/action/src/Tests/ConfigurationTest.php
@@ -30,7 +30,7 @@ class ConfigurationTest extends WebTestBase {
    */
   function testActionConfiguration() {
     // Create a user with permission to view the actions administration pages.
-    $user = $this->drupalCreateUser(array('administer actions'));
+    $user = $this->drupalCreateUser(array('administer_actions'));
     $this->drupalLogin($user);
 
     // Make a POST request to admin/config/system/actions.
diff --git a/core/modules/aggregator/aggregator.permissions.yml b/core/modules/aggregator/aggregator.permissions.yml
index e96ddb4..7b1dcb8 100644
--- a/core/modules/aggregator/aggregator.permissions.yml
+++ b/core/modules/aggregator/aggregator.permissions.yml
@@ -1,4 +1,4 @@
-administer news feeds:
+administer_news_feeds:
   title: 'Administer news feeds'
-access news feeds:
+access_news_feeds:
   title: 'View news feeds'
diff --git a/core/modules/aggregator/aggregator.routing.yml b/core/modules/aggregator/aggregator.routing.yml
index 58d7fcf..7c54d23 100644
--- a/core/modules/aggregator/aggregator.routing.yml
+++ b/core/modules/aggregator/aggregator.routing.yml
@@ -4,7 +4,7 @@ aggregator.admin_overview:
     _content: '\Drupal\aggregator\Controller\AggregatorController::adminOverview'
     _title: 'Feed aggregator'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
 
 aggregator.admin_settings:
   path: '/admin/config/services/aggregator/settings'
@@ -12,7 +12,7 @@ aggregator.admin_settings:
     _form: '\Drupal\aggregator\Form\SettingsForm'
     _title: 'Settings'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
 
 aggregator.feed_items_delete:
   path: '/admin/config/services/aggregator/delete/{aggregator_feed}'
@@ -20,7 +20,7 @@ aggregator.feed_items_delete:
     _entity_form: 'aggregator_feed.delete_items'
     _title: 'Delete items'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
 
 aggregator.feed_refresh:
   path: '/admin/config/services/aggregator/update/{aggregator_feed}'
@@ -28,7 +28,7 @@ aggregator.feed_refresh:
     _content: '\Drupal\aggregator\Controller\AggregatorController::feedRefresh'
     _title: 'Update items'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
     _csrf_token: 'TRUE'
 
 aggregator.opml_add:
@@ -37,7 +37,7 @@ aggregator.opml_add:
     _form: '\Drupal\aggregator\Form\OpmlFeedAdd'
     _title: 'Import OPML'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
 
 aggregator.feed_add:
   path: '/aggregator/sources/add'
@@ -45,7 +45,7 @@ aggregator.feed_add:
     _content: '\Drupal\aggregator\Controller\AggregatorController::feedAdd'
     _title: 'Add feed'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
   options:
     _admin_route: TRUE
 
@@ -55,7 +55,7 @@ entity.aggregator_feed.canonical:
     _entity_view: 'aggregator_feed'
     _title_callback: '\Drupal\aggregator\Controller\AggregatorController::feedTitle'
   requirements:
-    _permission: 'access news feeds'
+    _permission: 'access_news_feeds'
 
 entity.aggregator_feed.edit_form:
   path: '/aggregator/sources/{aggregator_feed}/configure'
@@ -63,7 +63,7 @@ entity.aggregator_feed.edit_form:
     _entity_form: 'aggregator_feed.default'
     _title: 'Configure'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
   options:
     _admin_route: TRUE
 
@@ -73,7 +73,7 @@ entity.aggregator_feed.delete_form:
     _entity_form: 'aggregator_feed.delete'
     _title: 'Delete feed'
   requirements:
-    _permission: 'administer news feeds'
+    _permission: 'administer_news_feeds'
   options:
     _admin_route: TRUE
 
@@ -83,4 +83,4 @@ aggregator.page_last:
     _content: '\Drupal\aggregator\Controller\AggregatorController::pageLast'
     _title: 'Feed aggregator'
   requirements:
-    _permission: 'access news feeds'
+    _permission: 'access_news_feeds'
diff --git a/core/modules/aggregator/config/install/views.view.aggregator_sources.yml b/core/modules/aggregator/config/install/views.view.aggregator_sources.yml
index c2f90ad..b477c48 100644
--- a/core/modules/aggregator/config/install/views.view.aggregator_sources.yml
+++ b/core/modules/aggregator/config/install/views.view.aggregator_sources.yml
@@ -22,7 +22,7 @@ display:
       access:
         type: perm
         options:
-          perm: 'access news feeds'
+          perm: 'access_news_feeds'
         provider: null
       cache:
         type: none
diff --git a/core/modules/aggregator/src/FeedAccessControlHandler.php b/core/modules/aggregator/src/FeedAccessControlHandler.php
index f147c53..d6b6199 100644
--- a/core/modules/aggregator/src/FeedAccessControlHandler.php
+++ b/core/modules/aggregator/src/FeedAccessControlHandler.php
@@ -25,11 +25,11 @@ class FeedAccessControlHandler extends EntityAccessControlHandler {
   protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
     switch ($operation) {
       case 'view':
-        return AccessResult::allowedIfHasPermission($account, 'access news feeds');
+        return AccessResult::allowedIfHasPermission($account, 'access_news_feeds');
         break;
 
       default:
-        return AccessResult::allowedIfHasPermission($account, 'administer news feeds');
+        return AccessResult::allowedIfHasPermission($account, 'administer_news_feeds');
         break;
     }
   }
@@ -38,7 +38,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
    * {@inheritdoc}
    */
   protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
-    return AccessResult::allowedIfHasPermission($account, 'administer news feeds');
+    return AccessResult::allowedIfHasPermission($account, 'administer_news_feeds');
   }
 
 }
diff --git a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
index 16ca1af..ba1163f 100644
--- a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
+++ b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
@@ -110,8 +110,8 @@ public function defaultConfiguration() {
    * {@inheritdoc}
    */
   protected function blockAccess(AccountInterface $account) {
-    // Only grant access to users with the 'access news feeds' permission.
-    return $account->hasPermission('access news feeds');
+    // Only grant access to users with the 'access_news_feeds' permission.
+    return $account->hasPermission('access_news_feeds');
   }
 
   /**
diff --git a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
index 844f0b1..1e79d97 100644
--- a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
+++ b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
@@ -34,10 +34,10 @@ public function testBlockLinks() {
 
     // Need admin user to be able to access block admin.
     $admin_user = $this->drupalCreateUser(array(
-      'administer blocks',
+      'administer_blocks',
       'access administration pages',
-      'administer news feeds',
-      'access news feeds',
+      'administer_news_feeds',
+      'access_news_feeds',
     ));
     $this->drupalLogin($admin_user);
 
diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
index 57fcf88..c2b6e57 100644
--- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
@@ -31,7 +31,7 @@ protected function setUp() {
       $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
     }
 
-    $web_user = $this->drupalCreateUser(array('access administration pages', 'administer news feeds', 'access news feeds', 'create article content'));
+    $web_user = $this->drupalCreateUser(array('access administration pages', 'administer_news_feeds', 'access_news_feeds', 'create article content'));
     $this->drupalLogin($web_user);
   }
 
diff --git a/core/modules/aggregator/src/Tests/FeedCacheTagsTest.php b/core/modules/aggregator/src/Tests/FeedCacheTagsTest.php
index 2ad5f5a..293d755 100644
--- a/core/modules/aggregator/src/Tests/FeedCacheTagsTest.php
+++ b/core/modules/aggregator/src/Tests/FeedCacheTagsTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // Give anonymous users permission to access feeds, so that we can verify
     // the cache tags of cached versions of feeds.
     $user_role = Role::load(DRUPAL_ANONYMOUS_RID);
-    $user_role->grantPermission('access news feeds');
+    $user_role->grantPermission('access_news_feeds');
     $user_role->save();
   }
 
diff --git a/core/modules/aggregator/src/Tests/ImportOpmlTest.php b/core/modules/aggregator/src/Tests/ImportOpmlTest.php
index 821a34a..246b6b2 100644
--- a/core/modules/aggregator/src/Tests/ImportOpmlTest.php
+++ b/core/modules/aggregator/src/Tests/ImportOpmlTest.php
@@ -24,7 +24,7 @@ class ImportOpmlTest extends AggregatorTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $admin_user = $this->drupalCreateUser(array('administer news feeds', 'access news feeds', 'create article content', 'administer blocks'));
+    $admin_user = $this->drupalCreateUser(array('administer_news_feeds', 'access_news_feeds', 'create article content', 'administer_blocks'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php b/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php
index f79a53c..178550f 100644
--- a/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php
+++ b/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     // Give anonymous users permission to access feeds, so that we can verify
     // the cache tags of cached versions of feed items.
     $user_role = Role::load(DRUPAL_ANONYMOUS_RID);
-    $user_role->grantPermission('access news feeds');
+    $user_role->grantPermission('access_news_feeds');
     $user_role->save();
   }
 
diff --git a/core/modules/ban/ban.permissions.yml b/core/modules/ban/ban.permissions.yml
index 7f385fd..c15eced 100644
--- a/core/modules/ban/ban.permissions.yml
+++ b/core/modules/ban/ban.permissions.yml
@@ -1,2 +1,2 @@
-ban IP addresses:
+ban_IP_addresses:
   title: 'Ban IP addresses'
diff --git a/core/modules/ban/ban.routing.yml b/core/modules/ban/ban.routing.yml
index 2420dc0..e388053 100644
--- a/core/modules/ban/ban.routing.yml
+++ b/core/modules/ban/ban.routing.yml
@@ -5,7 +5,7 @@ ban.admin_page:
     _title: 'IP address bans'
     default_ip: ''
   requirements:
-    _permission: 'ban IP addresses'
+    _permission: 'ban_IP_addresses'
 
 ban.delete:
   path: '/admin/config/people/ban/delete/{ban_id}'
@@ -13,4 +13,4 @@ ban.delete:
     _form: '\Drupal\ban\Form\BanDelete'
     _title: 'Delete IP address'
   requirements:
-    _permission: 'ban IP addresses'
+    _permission: 'ban_IP_addresses'
diff --git a/core/modules/ban/src/Tests/IpAddressBlockingTest.php b/core/modules/ban/src/Tests/IpAddressBlockingTest.php
index 0122ceb..6fbbcd7 100644
--- a/core/modules/ban/src/Tests/IpAddressBlockingTest.php
+++ b/core/modules/ban/src/Tests/IpAddressBlockingTest.php
@@ -28,7 +28,7 @@ class IpAddressBlockingTest extends WebTestBase {
    */
   function testIPAddressValidation() {
     // Create user.
-    $admin_user = $this->drupalCreateUser(array('ban IP addresses'));
+    $admin_user = $this->drupalCreateUser(array('ban_IP_addresses'));
     $this->drupalLogin($admin_user);
     $this->drupalGet('admin/config/people/ban');
 
diff --git a/core/modules/block/block.permissions.yml b/core/modules/block/block.permissions.yml
index 83f35cd..c2f2d72 100644
--- a/core/modules/block/block.permissions.yml
+++ b/core/modules/block/block.permissions.yml
@@ -1,2 +1,2 @@
-administer blocks:
+administer_blocks:
   title: 'Administer blocks'
diff --git a/core/modules/block/block.routing.yml b/core/modules/block/block.routing.yml
index d4276f5..bca4015 100644
--- a/core/modules/block/block.routing.yml
+++ b/core/modules/block/block.routing.yml
@@ -5,7 +5,7 @@ block.admin_demo:
     _title_callback: 'theme_handler:getName'
   requirements:
     _access_theme: 'TRUE'
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
   options:
     _admin_route: FALSE
 
@@ -15,7 +15,7 @@ entity.block.delete_form:
     _entity_form: 'block.delete'
     _title: 'Delete block'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 entity.block.edit_form:
   path: '/admin/structure/block/manage/{block}'
@@ -31,7 +31,7 @@ block.admin_display:
     _content: '\Drupal\block\Controller\BlockListController::listing'
     _title: 'Block layout'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 block.admin_display_theme:
   path: 'admin/structure/block/list/{theme}'
@@ -40,7 +40,7 @@ block.admin_display_theme:
     _title: 'Block layout'
   requirements:
     _access_theme: 'TRUE'
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 block.admin_add:
   path: '/admin/structure/block/add/{plugin_id}/{theme}'
@@ -49,11 +49,11 @@ block.admin_add:
     theme: null
     _title: 'Configure block'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 block.category_autocomplete:
   path: '/block-category/autocomplete'
   defaults:
     _controller: '\Drupal\block\Controller\CategoryAutocompleteController::autocomplete'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
diff --git a/core/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php
index 6f7f276..34edc6c 100644
--- a/core/modules/block/src/Entity/Block.php
+++ b/core/modules/block/src/Entity/Block.php
@@ -30,7 +30,7 @@
  *       "delete" = "Drupal\block\Form\BlockDeleteForm"
  *     }
  *   },
- *   admin_permission = "administer blocks",
+ *   admin_permission = "administer_blocks",
  *   entity_keys = {
  *     "id" = "id"
  *   },
diff --git a/core/modules/block/src/Tests/BlockAdminThemeTest.php b/core/modules/block/src/Tests/BlockAdminThemeTest.php
index 9a86f29..ad93077 100644
--- a/core/modules/block/src/Tests/BlockAdminThemeTest.php
+++ b/core/modules/block/src/Tests/BlockAdminThemeTest.php
@@ -28,7 +28,7 @@ class BlockAdminThemeTest extends WebTestBase {
    */
   function testAdminTheme() {
     // Create administrative user.
-    $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes'));
+    $admin_user = $this->drupalCreateUser(array('administer_blocks', 'administer themes'));
     $this->drupalLogin($admin_user);
 
     // Ensure that access to block admin page is denied when theme is not
diff --git a/core/modules/block/src/Tests/BlockCacheTest.php b/core/modules/block/src/Tests/BlockCacheTest.php
index fd9fc88..8ee621f 100644
--- a/core/modules/block/src/Tests/BlockCacheTest.php
+++ b/core/modules/block/src/Tests/BlockCacheTest.php
@@ -39,7 +39,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create an admin user, log in and enable test blocks.
-    $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages'));
+    $this->admin_user = $this->drupalCreateUser(array('administer_blocks', 'access administration pages'));
     $this->drupalLogin($this->admin_user);
 
     // Create additional users to test caching modes.
diff --git a/core/modules/block/src/Tests/BlockHiddenRegionTest.php b/core/modules/block/src/Tests/BlockHiddenRegionTest.php
index 95b06f3..5d80474 100644
--- a/core/modules/block/src/Tests/BlockHiddenRegionTest.php
+++ b/core/modules/block/src/Tests/BlockHiddenRegionTest.php
@@ -34,7 +34,7 @@ protected function setUp() {
 
     // Create administrative user.
     $this->adminUser = $this->drupalCreateUser(array(
-      'administer blocks',
+      'administer_blocks',
       'administer themes',
       'search content',
       )
diff --git a/core/modules/block/src/Tests/BlockHookOperationTest.php b/core/modules/block/src/Tests/BlockHookOperationTest.php
index c5758d3..49aa749 100644
--- a/core/modules/block/src/Tests/BlockHookOperationTest.php
+++ b/core/modules/block/src/Tests/BlockHookOperationTest.php
@@ -28,7 +28,7 @@ protected function setUp() {
     parent::setUp();
 
     $permissions = array(
-      'administer blocks',
+      'administer_blocks',
     );
 
     // Create and log in user.
diff --git a/core/modules/block/src/Tests/BlockInvalidRegionTest.php b/core/modules/block/src/Tests/BlockInvalidRegionTest.php
index 246684b..60e5ed7 100644
--- a/core/modules/block/src/Tests/BlockInvalidRegionTest.php
+++ b/core/modules/block/src/Tests/BlockInvalidRegionTest.php
@@ -31,7 +31,7 @@ protected function setUp() {
     $admin_user = $this->drupalCreateUser(array(
       'administer site configuration',
       'access administration pages',
-      'administer blocks',
+      'administer_blocks',
     ));
     $this->drupalLogin($admin_user);
   }
diff --git a/core/modules/block/src/Tests/BlockLanguageCacheTest.php b/core/modules/block/src/Tests/BlockLanguageCacheTest.php
index 432c387..8bd4b70 100644
--- a/core/modules/block/src/Tests/BlockLanguageCacheTest.php
+++ b/core/modules/block/src/Tests/BlockLanguageCacheTest.php
@@ -53,7 +53,7 @@ protected function setUp() {
   public function testBlockLinks() {
     // Create admin user to be able to access block admin.
     $admin_user = $this->drupalCreateUser(array(
-      'administer blocks',
+      'administer_blocks',
       'access administration pages',
       'administer menu',
     ));
diff --git a/core/modules/block/src/Tests/BlockLanguageTest.php b/core/modules/block/src/Tests/BlockLanguageTest.php
index 380c65c..65d00b0 100644
--- a/core/modules/block/src/Tests/BlockLanguageTest.php
+++ b/core/modules/block/src/Tests/BlockLanguageTest.php
@@ -34,7 +34,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create a new user, allow him to manage the blocks and the languages.
-    $this->adminUser = $this->drupalCreateUser(array('administer blocks', 'administer languages', 'administer site configuration'));
+    $this->adminUser = $this->drupalCreateUser(array('administer_blocks', 'administer languages', 'administer site configuration'));
     $this->drupalLogin($this->adminUser);
 
     // Add predefined language.
diff --git a/core/modules/block/src/Tests/BlockTestBase.php b/core/modules/block/src/Tests/BlockTestBase.php
index 5f33eb9..79e115c 100644
--- a/core/modules/block/src/Tests/BlockTestBase.php
+++ b/core/modules/block/src/Tests/BlockTestBase.php
@@ -51,7 +51,7 @@ protected function setUp() {
     // Create and log in an administrative user having access to the Full HTML
     // text format.
     $this->adminUser = $this->drupalCreateUser(array(
-      'administer blocks',
+      'administer_blocks',
       $full_html_format->getPermissionName(),
       'access administration pages',
     ));
diff --git a/core/modules/block/src/Tests/BlockTitleXSSTest.php b/core/modules/block/src/Tests/BlockTitleXSSTest.php
index 9eca4b5..9ffdcf6 100644
--- a/core/modules/block/src/Tests/BlockTitleXSSTest.php
+++ b/core/modules/block/src/Tests/BlockTitleXSSTest.php
@@ -37,7 +37,7 @@ function testXSSInTitle() {
     $this->drupalGet('');
     $this->assertNoRaw('<script>alert("XSS label");</script>', 'The block title was properly sanitized when rendered.');
 
-    $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'access administration pages')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer_blocks', 'access administration pages')));
     $default_theme = \Drupal::config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/list/' . $default_theme);
     $this->assertNoRaw("<script>alert('XSS subject');</script>", 'The block title was properly sanitized in Block Plugin UI Admin page.');
diff --git a/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php
index 7b6f945..1178ae9 100644
--- a/core/modules/block/src/Tests/BlockUiTest.php
+++ b/core/modules/block/src/Tests/BlockUiTest.php
@@ -48,7 +48,7 @@ protected function setUp() {
     parent::setUp();
     // Create and log in an administrative user.
     $this->adminUser = $this->drupalCreateUser(array(
-      'administer blocks',
+      'administer_blocks',
       'access administration pages',
     ));
     $this->drupalLogin($this->adminUser);
diff --git a/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php b/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php
index c2e7e03..9b16e76 100644
--- a/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php
+++ b/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php
@@ -27,7 +27,7 @@ class NonDefaultBlockAdminTest extends WebTestBase {
    * Test non-default theme admin.
    */
   function testNonDefaultBlockAdmin() {
-    $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes'));
+    $admin_user = $this->drupalCreateUser(array('administer_blocks', 'administer themes'));
     $this->drupalLogin($admin_user);
     $new_theme = 'bartik';
     \Drupal::service('theme_handler')->install(array($new_theme));
diff --git a/core/modules/block/src/Tests/Views/DisplayBlockTest.php b/core/modules/block/src/Tests/Views/DisplayBlockTest.php
index 3c0deab..5a4f602 100644
--- a/core/modules/block/src/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/src/Tests/Views/DisplayBlockTest.php
@@ -47,7 +47,7 @@ protected function setUp() {
    * Tests default and custom block categories.
    */
   public function testBlockCategory() {
-    $this->drupalLogin($this->drupalCreateUser(array('administer views', 'administer blocks')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer views', 'administer_blocks')));
 
     // Create a new view in the UI.
     $edit = array();
@@ -182,7 +182,7 @@ protected function testDeleteBlockDisplay() {
    * Test the block form for a Views block.
    */
   public function testViewsBlockForm() {
-    $this->drupalLogin($this->drupalCreateUser(array('administer blocks')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer_blocks')));
     $default_theme = \Drupal::config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme);
     $elements = $this->xpath('//input[@name="label"]');
@@ -270,7 +270,7 @@ public function testBlockRendering() {
    * Tests the contextual links on a Views block.
    */
   public function testBlockContextualLinks() {
-    $this->drupalLogin($this->drupalCreateUser(array('administer views', 'access contextual links', 'administer blocks')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer views', 'access contextual links', 'administer_blocks')));
     $block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
     $cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', array('cache' => array('max_age' => 3600)));
     $this->drupalGet('test-page');
diff --git a/core/modules/block_content/block_content.routing.yml b/core/modules/block_content/block_content.routing.yml
index 1628b89..757f87c 100644
--- a/core/modules/block_content/block_content.routing.yml
+++ b/core/modules/block_content/block_content.routing.yml
@@ -4,7 +4,7 @@ block_content.type_list:
     _entity_list: 'block_content_type'
     _title: 'Edit'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 block_content.add_page:
   path: '/block/add'
@@ -14,7 +14,7 @@ block_content.add_page:
   options:
     _admin_route: TRUE
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 block_content.add_form:
   path: '/block/add/{block_content_type}'
@@ -24,7 +24,7 @@ block_content.add_form:
   options:
     _admin_route: TRUE
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 entity.block_content_type.delete_form:
   path: '/admin/structure/block/block-content/manage/{block_content_type}/delete'
@@ -61,7 +61,7 @@ block_content.type_add:
     _entity_form: 'block_content_type.add'
     _title: 'Add'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
 
 entity.block_content_type.edit_form:
   path: '/admin/structure/block/block-content/manage/{block_content_type}'
@@ -77,4 +77,4 @@ block_content.list:
     _title: 'Custom block library'
     _entity_list: 'block_content'
   requirements:
-    _permission: 'administer blocks'
+    _permission: 'administer_blocks'
diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php
index 769a7f3..4b8538a 100644
--- a/core/modules/block_content/src/BlockContentForm.php
+++ b/core/modules/block_content/src/BlockContentForm.php
@@ -141,14 +141,14 @@ public function form(array $form, FormStateInterface $form_state) {
         'library' => array('block_content/drupal.block_content'),
       ),
       '#weight' => 20,
-      '#access' => $block->isNewRevision() || $account->hasPermission('administer blocks'),
+      '#access' => $block->isNewRevision() || $account->hasPermission('administer_blocks'),
     );
 
     $form['revision_information']['revision'] = array(
       '#type' => 'checkbox',
       '#title' => $this->t('Create new revision'),
       '#default_value' => $block->isNewRevision(),
-      '#access' => $account->hasPermission('administer blocks'),
+      '#access' => $account->hasPermission('administer_blocks'),
     );
 
     // Check the revision log checkbox when the log textarea is filled in.
diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php
index e2320bd..437fe6f 100644
--- a/core/modules/block_content/src/Entity/BlockContent.php
+++ b/core/modules/block_content/src/Entity/BlockContent.php
@@ -34,7 +34,7 @@
  *     },
  *     "translation" = "Drupal\block_content\BlockContentTranslationHandler"
  *   },
- *   admin_permission = "administer blocks",
+ *   admin_permission = "administer_blocks",
  *   base_table = "block_content",
  *   revision_table = "block_content_revision",
  *   data_table = "block_content_field_data",
diff --git a/core/modules/block_content/src/Entity/BlockContentType.php b/core/modules/block_content/src/Entity/BlockContentType.php
index 007ebfb..5849b35 100644
--- a/core/modules/block_content/src/Entity/BlockContentType.php
+++ b/core/modules/block_content/src/Entity/BlockContentType.php
@@ -27,7 +27,7 @@
  *     },
  *     "list_builder" = "Drupal\block_content\BlockContentTypeListBuilder"
  *   },
- *   admin_permission = "administer blocks",
+ *   admin_permission = "administer_blocks",
  *   config_prefix = "type",
  *   bundle_of = "block_content",
  *   entity_keys = {
diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
index 51ea7e5..33cf2a5 100644
--- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
+++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
@@ -160,7 +160,7 @@ public function build() {
           '%uuid' => $uuid,
           '!url' => $this->urlGenerator->generate('block_content.add_page')
         )),
-        '#access' => $this->account->hasPermission('administer blocks')
+        '#access' => $this->account->hasPermission('administer_blocks')
       );
     }
   }
diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListTest.php
index 07a3299..3342fe5 100644
--- a/core/modules/block_content/src/Tests/BlockContentListTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentListTest.php
@@ -28,7 +28,7 @@ class BlockContentListTest extends WebTestBase {
    * Tests the custom block listing page.
    */
   public function testListing() {
-    $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'translate configuration')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer_blocks', 'translate_configuration')));
     $this->drupalGet('admin/structure/block/block-content');
 
     // Test for the page title.
diff --git a/core/modules/block_content/src/Tests/BlockContentTestBase.php b/core/modules/block_content/src/Tests/BlockContentTestBase.php
index 5bb7122..870045c 100644
--- a/core/modules/block_content/src/Tests/BlockContentTestBase.php
+++ b/core/modules/block_content/src/Tests/BlockContentTestBase.php
@@ -32,7 +32,7 @@
    * @var array
    */
   protected $permissions = array(
-    'administer blocks'
+    'administer_blocks'
   );
 
   /**
diff --git a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php
index aec6f69..8c58d6c 100644
--- a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php
+++ b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php
@@ -47,7 +47,7 @@ public function getTranslatorPermissions() {
     return array_merge(parent::getTranslatorPermissions(), array(
       'translate any entity',
       'access administration pages',
-      'administer blocks',
+      'administer_blocks',
       'administer block_content fields'
     ));
   }
diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php
index 76dfdb7..350c6f5 100644
--- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php
@@ -27,7 +27,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
    * @var array
    */
   protected $permissions = array(
-    'administer blocks',
+    'administer_blocks',
     'administer block_content fields'
   );
 
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index cea9627..0d421f1 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -103,14 +103,14 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
       if ($context['view_mode'] == 'full' && node_is_page($node)) {
         $child_type = \Drupal::config('book.settings')->get('child_type');
         $access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node');
-        if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) {
+        if (($account->hasPermission('add_content_to_books') || $account->hasPermission('administer_book_outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) {
           $links['book_add_child'] = array(
             'title' => t('Add child page'),
             'url' => Url::fromRoute('node.add', ['node_type' => $child_type], ['query' => ['parent' => $node->id()]]),
           );
         }
 
-        if ($account->hasPermission('access printer-friendly version')) {
+        if ($account->hasPermission('access_printer-friendly_version')) {
           $links['book_printer'] = array(
             'title' => t('Printer-friendly version'),
             'url' => Url::fromRoute('book.export', [
@@ -143,9 +143,9 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
 function book_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
   $node = $form_state->getFormObject()->getEntity();
   $account = \Drupal::currentUser();
-  $access = $account->hasPermission('administer book outlines');
+  $access = $account->hasPermission('administer_book_outlines');
   if (!$access) {
-    if ($account->hasPermission('add content to books') && ((!empty($node->book['bid']) && !$node->isNew()) || book_type_is_allowed($node->getType()))) {
+    if ($account->hasPermission('add_content_to_books') && ((!empty($node->book['bid']) && !$node->isNew()) || book_type_is_allowed($node->getType()))) {
       // Already in the book hierarchy, or this node type is allowed.
       $access = TRUE;
     }
@@ -302,7 +302,7 @@ function book_node_prepare_form(NodeInterface $node, $operation, FormStateInterf
 
   // Prepare defaults for the add/edit form.
   $account = \Drupal::currentUser();
-  if (empty($node->book) && ($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines'))) {
+  if (empty($node->book) && ($account->hasPermission('add_content_to_books') || $account->hasPermission('administer_book_outlines'))) {
     $node->book = array();
 
     $query = \Drupal::request()->query;
diff --git a/core/modules/book/book.permissions.yml b/core/modules/book/book.permissions.yml
index 52dd9d0..3a69f2a 100644
--- a/core/modules/book/book.permissions.yml
+++ b/core/modules/book/book.permissions.yml
@@ -1,9 +1,9 @@
-administer book outlines:
+administer_book_outlines:
   title: 'Administer book outlines'
-create new books:
+create_new_books:
   title: 'Create new books'
-add content to books:
+add_content_to_books:
   title: 'Add content and child pages to books'
-access printer-friendly version:
+access_printer-friendly_version:
   title: 'View printer-friendly books'
   description: 'View a book page and all of its sub-pages as a single document for ease of printing. Can be performance heavy.'
diff --git a/core/modules/book/book.routing.yml b/core/modules/book/book.routing.yml
index 13c0f10..65a74c8 100644
--- a/core/modules/book/book.routing.yml
+++ b/core/modules/book/book.routing.yml
@@ -12,7 +12,7 @@ book.admin:
     _content: '\Drupal\book\Controller\BookController::adminOverview'
     _title: 'Books'
   requirements:
-    _permission: 'administer book outlines'
+    _permission: 'administer_book_outlines'
 
 book.settings:
   path: '/admin/structure/book/settings'
@@ -27,7 +27,7 @@ book.export:
   defaults:
     _controller: '\Drupal\book\Controller\BookController::bookExport'
   requirements:
-    _permission: 'access printer-friendly version'
+    _permission: 'access_printer-friendly_version'
     _entity_access: 'node.view'
 
 entity.node.book_outline_form:
@@ -36,7 +36,7 @@ entity.node.book_outline_form:
     _entity_form: 'node.book_outline'
     _title: 'Outline'
   requirements:
-    _permission: 'administer book outlines'
+    _permission: 'administer_book_outlines'
     _entity_access: 'node.view'
   options:
     _node_operation_route: TRUE
@@ -47,7 +47,7 @@ book.admin_edit:
     _form: 'Drupal\book\Form\BookAdminEditForm'
     _title: 'Re-order book pages and change titles'
   requirements:
-    _permission: 'administer book outlines'
+    _permission: 'administer_book_outlines'
     _entity_access: 'node.view'
     node: \d+
 
@@ -60,6 +60,6 @@ entity.node.book_remove_form:
     _access_mode: 'ALL'
     _node_operation_route: TRUE
   requirements:
-    _permission: 'administer book outlines'
+    _permission: 'administer_book_outlines'
     _entity_access: 'node.view'
     _access_book_removable: 'TRUE'
diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php
index 8f2ab35..6a9215f 100644
--- a/core/modules/book/src/BookManager.php
+++ b/core/modules/book/src/BookManager.php
@@ -199,7 +199,7 @@ public function addFormElements(array $form, FormStateInterface $form_state, Nod
       }
     }
 
-    if ($account->hasPermission('create new books') && ($nid == 'new' || ($nid != $node->book['original_bid']))) {
+    if ($account->hasPermission('create_new_books') && ($nid == 'new' || ($nid != $node->book['original_bid']))) {
       // The node can become a new book, if it is not one already.
       $options = array($nid => $this->t('- Create a new book -')) + $options;
     }
diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php
index b229104..481493b 100644
--- a/core/modules/book/src/Tests/BookTest.php
+++ b/core/modules/book/src/Tests/BookTest.php
@@ -59,9 +59,9 @@ protected function setUp() {
     node_access_rebuild();
 
     // Create users.
-    $this->book_author = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books'));
-    $this->web_user = $this->drupalCreateUser(array('access printer-friendly version', 'node test view'));
-    $this->admin_user = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'node test view', 'administer content types', 'administer site configuration'));
+    $this->book_author = $this->drupalCreateUser(array('create_new_books', 'create book content', 'edit own book content', 'add_content_to_books'));
+    $this->web_user = $this->drupalCreateUser(array('access_printer-friendly_version', 'node test view'));
+    $this->admin_user = $this->drupalCreateUser(array('create_new_books', 'create book content', 'edit own book content', 'add_content_to_books', 'administer_blocks', 'administer permissions', 'administer_book_outlines', 'node test view', 'administer content types', 'administer site configuration'));
   }
 
   /**
@@ -344,7 +344,7 @@ function testBookExport() {
     // Now grant anonymous users permission to view the printer-friendly
     // version and verify that node access restrictions still prevent them from
     // seeing it.
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access printer-friendly version'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_printer-friendly_version'));
     $this->drupalGet('book/export/html/' . $this->book->id());
     $this->assertResponse('403', 'Anonymous user properly forbidden from seeing the printer-friendly version when denied by node access.');
   }
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index bdf53bf..186080d 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -459,9 +459,9 @@ function comment_node_update_index(EntityInterface $node, $langcode) {
     // comments.
     $index_comments = TRUE;
     $roles = \Drupal::entityManager()->getStorage('user_role')->loadMultiple();
-    $authenticated_can_access = $roles[DRUPAL_AUTHENTICATED_RID]->hasPermission('access comments');
+    $authenticated_can_access = $roles[DRUPAL_AUTHENTICATED_RID]->hasPermission('access_comments');
     foreach ($roles as $rid => $role) {
-      if ($role->hasPermission('search content') && !$role->hasPermission('access comments')) {
+      if ($role->hasPermission('search content') && !$role->hasPermission('access_comments')) {
         if ($rid == DRUPAL_AUTHENTICATED_RID || $rid == DRUPAL_ANONYMOUS_RID || !$authenticated_can_access) {
           $index_comments = FALSE;
           break;
@@ -520,7 +520,7 @@ function comment_node_search_result(EntityInterface $node) {
     }
     // Do not make a string if comments are hidden.
     $status = $node->get($field_name)->status;
-    if (\Drupal::currentUser()->hasPermission('access comments') && $status != CommentItemInterface::HIDDEN) {
+    if (\Drupal::currentUser()->hasPermission('access_comments') && $status != CommentItemInterface::HIDDEN) {
       if ($status == CommentItemInterface::OPEN) {
         // At least one comment field is open.
         $open = TRUE;
diff --git a/core/modules/comment/comment.permissions.yml b/core/modules/comment/comment.permissions.yml
index 664b5e1..5446d1c 100644
--- a/core/modules/comment/comment.permissions.yml
+++ b/core/modules/comment/comment.permissions.yml
@@ -1,13 +1,13 @@
-administer comments:
+administer_comments:
   title: 'Administer comments and comment settings'
-administer comment types:
+administer_comment_types:
   title: 'Administer comment types and settings'
   restrict access: true
-access comments:
+access_comments:
   title: 'View comments'
-post comments:
+post_comments:
   title: 'Post comments'
-skip comment approval:
+skip_comment_approval:
   title: 'Skip comment approval'
-edit own comments:
+edit_own_comments:
   title: 'Edit own comments'
diff --git a/core/modules/comment/comment.routing.yml b/core/modules/comment/comment.routing.yml
index ca37c61..9dd7714 100644
--- a/core/modules/comment/comment.routing.yml
+++ b/core/modules/comment/comment.routing.yml
@@ -5,7 +5,7 @@ comment.admin:
     _content: '\Drupal\comment\Controller\AdminController::adminPage'
     type: 'new'
   requirements:
-    _permission: 'administer comments'
+    _permission: 'administer_comments'
 
 comment.admin_approval:
   path: '/admin/content/comment/approval'
@@ -14,7 +14,7 @@ comment.admin_approval:
     _content: '\Drupal\comment\Controller\AdminController::adminPage'
     type: 'approval'
   requirements:
-    _permission: 'administer comments'
+    _permission: 'administer_comments'
 
 entity.comment.edit_form:
   path: '/comment/{comment}/edit'
@@ -84,7 +84,7 @@ comment.type_list:
     _entity_list: 'comment_type'
     _title: 'Comment types'
   requirements:
-    _permission: 'administer comment types'
+    _permission: 'administer_comment_types'
   options:
     _admin_route: TRUE
 
@@ -104,7 +104,7 @@ entity.comment_type.add_form:
     _entity_form: 'comment_type.add'
     _title: 'Add'
   requirements:
-    _permission: 'administer comment types'
+    _permission: 'administer_comment_types'
   options:
     _admin_route: TRUE
 
diff --git a/core/modules/comment/config/install/views.view.comments_recent.yml b/core/modules/comment/config/install/views.view.comments_recent.yml
index 7a4b559..4748738 100644
--- a/core/modules/comment/config/install/views.view.comments_recent.yml
+++ b/core/modules/comment/config/install/views.view.comments_recent.yml
@@ -21,7 +21,7 @@ display:
       access:
         type: perm
         options:
-          perm: 'access comments'
+          perm: 'access_comments'
         provider: user
       cache:
         type: none
diff --git a/core/modules/comment/src/CommentAccessControlHandler.php b/core/modules/comment/src/CommentAccessControlHandler.php
index b78c4b0..f442ece 100644
--- a/core/modules/comment/src/CommentAccessControlHandler.php
+++ b/core/modules/comment/src/CommentAccessControlHandler.php
@@ -27,18 +27,18 @@ class CommentAccessControlHandler extends EntityAccessControlHandler {
   protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
     /** @var \Drupal\Core\Entity\EntityInterface|\Drupal\user\EntityOwnerInterface $entity */
 
-    if ($account->hasPermission('administer comments')) {
+    if ($account->hasPermission('administer_comments')) {
       $access = AccessResult::allowed()->cachePerRole();
       return ($operation != 'view') ? $access : $access->andIf($entity->getCommentedEntity()->access($operation, $account, TRUE));
     }
 
     switch ($operation) {
       case 'view':
-        return AccessResult::allowedIf($account->hasPermission('access comments') && $entity->isPublished())->cachePerRole()->cacheUntilEntityChanges($entity)
+        return AccessResult::allowedIf($account->hasPermission('access_comments') && $entity->isPublished())->cachePerRole()->cacheUntilEntityChanges($entity)
           ->andIf($entity->getCommentedEntity()->access($operation, $account, TRUE));
 
       case 'update':
-        return AccessResult::allowedIf($account->id() && $account->id() == $entity->getOwnerId() && $entity->isPublished() && $account->hasPermission('edit own comments'))->cachePerRole()->cachePerUser()->cacheUntilEntityChanges($entity);
+        return AccessResult::allowedIf($account->id() && $account->id() == $entity->getOwnerId() && $entity->isPublished() && $account->hasPermission('edit_own_comments'))->cachePerRole()->cachePerUser()->cacheUntilEntityChanges($entity);
 
       default:
         // No opinion.
@@ -50,7 +50,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
    * {@inheritdoc}
    */
   protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
-    return AccessResult::allowedIfHasPermission($account, 'post comments');
+    return AccessResult::allowedIfHasPermission($account, 'post_comments');
   }
 
   /**
@@ -60,7 +60,7 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
     /** @var \Drupal\comment\CommentInterface $entity */
     $entity = $items->getEntity();
     if ($operation == 'edit') {
-      // Only users with the "administer comments" permission can edit
+      // Only users with the "administer_comments" permission can edit
       // administrative fields.
       $administrative_fields = array(
         'uid',
@@ -69,7 +69,7 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
         'date',
       );
       if (in_array($field_definition->getName(), $administrative_fields, TRUE)) {
-        return AccessResult::allowedIfHasPermission($account, 'administer comments');
+        return AccessResult::allowedIfHasPermission($account, 'administer_comments');
       }
 
       // No user can change read-only fields.
@@ -95,8 +95,8 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
       // can edit name, homepage and mail. Anonymous users can also fill in the
       // fields on comment creation.
       if (in_array($field_definition->getName(), ['name', 'mail', 'homepage'], TRUE)) {
-        $admin_access = AccessResult::allowedIfHasPermission($account, 'administer comments');
-        $anonymous_access = AccessResult::allowedIf($entity->isNew() && $account->isAnonymous() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT && $account->hasPermission('post comments'))
+        $admin_access = AccessResult::allowedIfHasPermission($account, 'administer_comments');
+        $anonymous_access = AccessResult::allowedIf($entity->isNew() && $account->isAnonymous() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT && $account->hasPermission('post_comments'))
           ->cachePerRole()
           ->cacheUntilEntityChanges($entity)
           ->cacheUntilEntityChanges($field_definition->getConfig($commented_entity->bundle()))
@@ -107,11 +107,11 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
 
     if ($operation == 'view') {
       // Admins can view any fields except hostname, other users need both the
-      // "access comments" permission and for the comment to be published. The
+      // "access_comments" permission and for the comment to be published. The
       // mail field is hidden from non-admins.
-      $admin_access = AccessResult::allowedIf($account->hasPermission('administer comments') && $field_definition->getName() != 'hostname')
+      $admin_access = AccessResult::allowedIf($account->hasPermission('administer_comments') && $field_definition->getName() != 'hostname')
         ->cachePerRole();
-      $anonymous_access = AccessResult::allowedIf($account->hasPermission('access comments') && $entity->isPublished() && !in_array($field_definition->getName(), array('mail', 'hostname'), TRUE))
+      $anonymous_access = AccessResult::allowedIf($account->hasPermission('access_comments') && $entity->isPublished() && !in_array($field_definition->getName(), array('mail', 'hostname'), TRUE))
         ->cacheUntilEntityChanges($entity)
         ->cachePerRole();
       return $admin_access->orIf($anonymous_access);
diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php
index 35e033d..ac523ec 100644
--- a/core/modules/comment/src/CommentForm.php
+++ b/core/modules/comment/src/CommentForm.php
@@ -85,7 +85,7 @@ public function form(array $form, FormStateInterface $form_state) {
     $form['#theme'] = array('comment_form__' . $entity->getEntityTypeId() . '__' . $entity->bundle() . '__' . $field_name, 'comment_form');
 
     $anonymous_contact = $field_definition->getSetting('anonymous');
-    $is_admin = $comment->id() && $this->currentUser->hasPermission('administer comments');
+    $is_admin = $comment->id() && $this->currentUser->hasPermission('administer_comments');
 
     if (!$this->currentUser->isAuthenticated() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
       $form['#attached']['library'][] = 'core/drupal.form';
@@ -129,7 +129,7 @@ public function form(array $form, FormStateInterface $form_state) {
       else {
         $author = ($comment->getAuthorName() ? $comment->getAuthorName() : '');
       }
-      $status = ($this->currentUser->hasPermission('skip comment approval') ? CommentInterface::PUBLISHED : CommentInterface::NOT_PUBLISHED);
+      $status = ($this->currentUser->hasPermission('skip_comment_approval') ? CommentInterface::PUBLISHED : CommentInterface::NOT_PUBLISHED);
     }
 
     $date = '';
@@ -239,7 +239,7 @@ protected function actions(array $form, FormStateInterface $form_state) {
 
     // Only show the save button if comment previews are optional or if we are
     // already previewing the submission.
-    $element['submit']['#access'] = ($comment->id() && $this->currentUser->hasPermission('administer comments')) || $preview_mode != DRUPAL_REQUIRED || $form_state->get('comment_preview');
+    $element['submit']['#access'] = ($comment->id() && $this->currentUser->hasPermission('administer_comments')) || $preview_mode != DRUPAL_REQUIRED || $form_state->get('comment_preview');
 
     $element['preview'] = array(
       '#type' => 'submit',
@@ -365,7 +365,7 @@ public function save(array $form, FormStateInterface $form_state) {
     $uri = $entity->urlInfo();
     $logger = $this->logger('content');
 
-    if ($this->currentUser->hasPermission('post comments') && ($this->currentUser->hasPermission('administer comments') || $entity->{$field_name}->status == CommentItemInterface::OPEN)) {
+    if ($this->currentUser->hasPermission('post_comments') && ($this->currentUser->hasPermission('administer_comments') || $entity->{$field_name}->status == CommentItemInterface::OPEN)) {
       $comment->save();
       $form_state->setValue('cid', $comment->id());
 
@@ -377,7 +377,7 @@ public function save(array $form, FormStateInterface $form_state) {
 
       // Explain the approval queue if necessary.
       if (!$comment->isPublished()) {
-        if (!$this->currentUser->hasPermission('administer comments')) {
+        if (!$this->currentUser->hasPermission('administer_comments')) {
           drupal_set_message($this->t('Your comment has been queued for review by site administrators and will be published after approval.'));
         }
       }
diff --git a/core/modules/comment/src/CommentLinkBuilder.php b/core/modules/comment/src/CommentLinkBuilder.php
index f689b1a..74c9a94 100644
--- a/core/modules/comment/src/CommentLinkBuilder.php
+++ b/core/modules/comment/src/CommentLinkBuilder.php
@@ -105,7 +105,7 @@ public function buildCommentedEntityLinks(FieldableEntityInterface $entity, arra
           // Teaser view: display the number of comments that have been posted,
           // or a link to add new comments if the user has permission, the
           // entity is open to new comments, and there currently are none.
-          if ($this->currentUser->hasPermission('access comments')) {
+          if ($this->currentUser->hasPermission('access_comments')) {
             if (!empty($entity->get($field_name)->comment_count)) {
               $links['comment-comments'] = array(
                 'title' => $this->formatPlural($entity->get($field_name)->comment_count, '1 comment', '@count comments'),
@@ -130,7 +130,7 @@ public function buildCommentedEntityLinks(FieldableEntityInterface $entity, arra
           // Provide a link to new comment form.
           if ($commenting_status == CommentItemInterface::OPEN) {
             $comment_form_location = $field_definition->getSetting('form_location');
-            if ($this->currentUser->hasPermission('post comments')) {
+            if ($this->currentUser->hasPermission('post_comments')) {
               $links['comment-add'] = array(
                 'title' => $this->t('Add new comment'),
                 'language' => $entity->language(),
@@ -162,10 +162,10 @@ public function buildCommentedEntityLinks(FieldableEntityInterface $entity, arra
           // comments.
           if ($commenting_status == CommentItemInterface::OPEN) {
             $comment_form_location = $field_definition->getSetting('form_location');
-            if ($this->currentUser->hasPermission('post comments')) {
+            if ($this->currentUser->hasPermission('post_comments')) {
               // Show the "post comment" link if the form is on another page, or
               // if there are existing comments that the link will skip past.
-              if ($comment_form_location == CommentItemInterface::FORM_SEPARATE_PAGE || (!empty($entity->get($field_name)->comment_count) && $this->currentUser->hasPermission('access comments'))) {
+              if ($comment_form_location == CommentItemInterface::FORM_SEPARATE_PAGE || (!empty($entity->get($field_name)->comment_count) && $this->currentUser->hasPermission('access_comments'))) {
                 $links['comment-add'] = array(
                   'title' => $this->t('Add new comment'),
                   'attributes' => array('title' => $this->t('Share your thoughts and opinions related to this posting.')),
diff --git a/core/modules/comment/src/CommentManager.php b/core/modules/comment/src/CommentManager.php
index 0094a01..c62b1e9 100644
--- a/core/modules/comment/src/CommentManager.php
+++ b/core/modules/comment/src/CommentManager.php
@@ -266,7 +266,7 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) {
       $this->authenticatedCanPostComments = $this->entityManager
         ->getStorage('user_role')
         ->load(DRUPAL_AUTHENTICATED_RID)
-        ->hasPermission('post comments');
+        ->hasPermission('post_comments');
     }
 
     if ($this->authenticatedCanPostComments) {
diff --git a/core/modules/comment/src/CommentStorage.php b/core/modules/comment/src/CommentStorage.php
index 2cbaed7..ecc2c1d 100644
--- a/core/modules/comment/src/CommentStorage.php
+++ b/core/modules/comment/src/CommentStorage.php
@@ -103,7 +103,7 @@ public function getDisplayOrdinal(CommentInterface $comment, $comment_mode, $div
     $query->innerJoin('comment_field_data', 'c2', 'c2.entity_id = c1.entity_id AND c2.entity_type = c1.entity_type AND c2.field_name = c1.field_name');
     $query->addExpression('COUNT(*)', 'count');
     $query->condition('c2.cid', $comment->id());
-    if (!$this->currentUser->hasPermission('administer comments')) {
+    if (!$this->currentUser->hasPermission('administer_comments')) {
       $query->condition('c1.status', CommentInterface::PUBLISHED);
     }
 
@@ -292,7 +292,7 @@ public function loadThread(EntityInterface $entity, $field_name, $mode, $comment
       ->addMetaData('entity', $entity)
       ->addMetaData('field_name', $field_name);
 
-    if (!$this->currentUser->hasPermission('administer comments')) {
+    if (!$this->currentUser->hasPermission('administer_comments')) {
       $query->condition('c.status', CommentInterface::PUBLISHED);
       $count_query->condition('c.status', CommentInterface::PUBLISHED);
     }
diff --git a/core/modules/comment/src/Controller/CommentController.php b/core/modules/comment/src/Controller/CommentController.php
index af415d0..3523aea 100644
--- a/core/modules/comment/src/Controller/CommentController.php
+++ b/core/modules/comment/src/Controller/CommentController.php
@@ -157,7 +157,7 @@ public function redirectNode(EntityInterface $node) {
    *   - replies to comments
    *   - replies to entities
    *   - attempts to reply to entities that can no longer accept comments
-   *   - respecting access permissions ('access comments', 'post comments',
+   *   - respecting access permissions ('access_comments', 'post_comments',
    *     etc.)
    *
    * @param \Symfony\Component\HttpFoundation\Request $request
@@ -201,7 +201,7 @@ public function getReplyForm(Request $request, EntityInterface $entity, $field_n
     $build = array();
 
     // Check if the user has the proper permissions.
-    if (!$account->hasPermission('post comments')) {
+    if (!$account->hasPermission('post_comments')) {
       drupal_set_message($this->t('You are not authorized to post comments.'), 'error');
       return new RedirectResponse($uri->toString());
     }
@@ -217,7 +217,7 @@ public function getReplyForm(Request $request, EntityInterface $entity, $field_n
       // $pid indicates that this is a reply to a comment.
       if ($pid) {
         // Check if the user has the proper permissions.
-        if (!$account->hasPermission('access comments')) {
+        if (!$account->hasPermission('access_comments')) {
           drupal_set_message($this->t('You are not authorized to view comments.'), 'error');
           return new RedirectResponse($uri->toString());
         }
diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index 57c7287..8cf5571 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -68,7 +68,7 @@ public function preSave(EntityStorageInterface $storage) {
     parent::preSave($storage);
 
     if (is_null($this->get('status')->value)) {
-      $published = \Drupal::currentUser()->hasPermission('skip comment approval') ? CommentInterface::PUBLISHED : CommentInterface::NOT_PUBLISHED;
+      $published = \Drupal::currentUser()->hasPermission('skip_comment_approval') ? CommentInterface::PUBLISHED : CommentInterface::NOT_PUBLISHED;
       $this->setPublished($published);
     }
     if ($this->isNew()) {
diff --git a/core/modules/comment/src/Entity/CommentType.php b/core/modules/comment/src/Entity/CommentType.php
index 3a1b3a8..19a2333 100644
--- a/core/modules/comment/src/Entity/CommentType.php
+++ b/core/modules/comment/src/Entity/CommentType.php
@@ -26,7 +26,7 @@
  *     },
  *     "list_builder" = "Drupal\comment\CommentTypeListBuilder"
  *   },
- *   admin_permission = "administer comment types",
+ *   admin_permission = "administer_comment_types",
  *   config_prefix = "type",
  *   bundle_of = "comment",
  *   entity_keys = {
diff --git a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
index 02c3107..74f1a37 100644
--- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
+++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
@@ -157,12 +157,12 @@ public function viewElements(FieldItemListInterface $items) {
       // Unpublished comments are not included in
       // $entity->get($field_name)->comment_count, but unpublished comments
       // should display if the user is an administrator.
-      if ($this->currentUser->hasPermission('access comments') || $this->currentUser->hasPermission('administer comments')) {
+      if ($this->currentUser->hasPermission('access_comments') || $this->currentUser->hasPermission('administer_comments')) {
         // This is a listing of Comment entities, so associate its list cache
         // tag for correct invalidation.
         $output['comments']['#cache']['tags'] = $this->entityManager->getDefinition('comment')->getListCacheTags();
 
-        if ($entity->get($field_name)->comment_count || $this->currentUser->hasPermission('administer comments')) {
+        if ($entity->get($field_name)->comment_count || $this->currentUser->hasPermission('administer_comments')) {
           $mode = $comment_settings['default_mode'];
           $comments_per_page = $comment_settings['per_page'];
           $comments = $this->storage->loadThread($entity, $field_name, $mode, $comments_per_page, $this->getSetting('pager_id'));
@@ -182,7 +182,7 @@ public function viewElements(FieldItemListInterface $items) {
       // display below the entity. Do not show the form for the print view mode.
       if ($status == CommentItemInterface::OPEN && $comment_settings['form_location'] == CommentItemInterface::FORM_BELOW && $this->viewMode != 'print') {
         // Only show the add comment form if the user has permission.
-        if ($this->currentUser->hasPermission('post comments')) {
+        if ($this->currentUser->hasPermission('post_comments')) {
           // All users in the "anonymous" role can use the same form: it is fine
           // for this form to be stored in the render cache.
           if ($this->currentUser->isAnonymous()) {
diff --git a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
index 93274a5..900d3de 100644
--- a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
+++ b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
@@ -138,7 +138,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
         COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'),
         COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information'),
       ),
-      '#access' => $anonymous_user->hasPermission('post comments'),
+      '#access' => $anonymous_user->hasPermission('post_comments'),
     );
     $element['comment']['form_location'] = array(
       '#type' => 'checkbox',
diff --git a/core/modules/comment/src/Plugin/entity_reference/selection/CommentSelection.php b/core/modules/comment/src/Plugin/entity_reference/selection/CommentSelection.php
index b6f63a0..043795c 100644
--- a/core/modules/comment/src/Plugin/entity_reference/selection/CommentSelection.php
+++ b/core/modules/comment/src/Plugin/entity_reference/selection/CommentSelection.php
@@ -33,7 +33,7 @@ public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
     // Adding the 'comment_access' tag is sadly insufficient for comments:
     // core requires us to also know about the concept of 'published' and
     // 'unpublished'.
-    if (!\Drupal::currentUser()->hasPermission('administer comments')) {
+    if (!\Drupal::currentUser()->hasPermission('administer_comments')) {
       $query->condition('status', CommentInterface::PUBLISHED);
     }
     return $query;
diff --git a/core/modules/comment/src/Plugin/views/field/LinkApprove.php b/core/modules/comment/src/Plugin/views/field/LinkApprove.php
index 095eacd..985992f 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkApprove.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkApprove.php
@@ -24,8 +24,8 @@ class LinkApprove extends Link {
    * {@inheritdoc}
    */
   public function access(AccountInterface $account) {
-    //needs permission to administer comments in general
-    return $account->hasPermission('administer comments');
+    //needs permission to administer_comments in general
+    return $account->hasPermission('administer_comments');
   }
 
   /**
diff --git a/core/modules/comment/src/Plugin/views/field/LinkDelete.php b/core/modules/comment/src/Plugin/views/field/LinkDelete.php
index f22563b..6b0b141 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkDelete.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkDelete.php
@@ -23,8 +23,8 @@ class LinkDelete extends Link {
    * {@inheritdoc}
    */
   public function access(AccountInterface $account) {
-    //needs permission to administer comments in general
-    return $account->hasPermission('administer comments');
+    //needs permission to administer_comments in general
+    return $account->hasPermission('administer_comments');
   }
 
   /**
diff --git a/core/modules/comment/src/Plugin/views/field/LinkReply.php b/core/modules/comment/src/Plugin/views/field/LinkReply.php
index d9f6914..7e6030a 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkReply.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkReply.php
@@ -24,7 +24,7 @@ class LinkReply extends Link {
    */
   public function access(AccountInterface $account) {
     //check for permission to reply to comments
-    return $account->hasPermission('post comments');
+    return $account->hasPermission('post_comments');
   }
 
   /**
diff --git a/core/modules/comment/src/Tests/CommentAdminTest.php b/core/modules/comment/src/Tests/CommentAdminTest.php
index 811dfde..eaa1d27 100644
--- a/core/modules/comment/src/Tests/CommentAdminTest.php
+++ b/core/modules/comment/src/Tests/CommentAdminTest.php
@@ -19,9 +19,9 @@ class CommentAdminTest extends CommentTestBase {
   function testApprovalAdminInterface() {
     // Set anonymous comments to require approval.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => TRUE,
-      'skip comment approval' => FALSE,
+      'access_comments' => TRUE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => FALSE,
     ));
     $this->drupalLogin($this->admin_user);
     $this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
@@ -101,9 +101,9 @@ function testApprovalAdminInterface() {
   function testApprovalNodeInterface() {
     // Set anonymous comments to require approval.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => TRUE,
-      'skip comment approval' => FALSE,
+      'access_comments' => TRUE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => FALSE,
     ));
     $this->drupalLogin($this->admin_user);
     $this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
diff --git a/core/modules/comment/src/Tests/CommentAnonymousTest.php b/core/modules/comment/src/Tests/CommentAnonymousTest.php
index da4b453..ff70a0c 100644
--- a/core/modules/comment/src/Tests/CommentAnonymousTest.php
+++ b/core/modules/comment/src/Tests/CommentAnonymousTest.php
@@ -19,14 +19,14 @@ protected function setUp() {
 
     // Enable anonymous and authenticated user comments.
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
     ));
     user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array(
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
     ));
   }
 
@@ -116,9 +116,9 @@ function testAnonymous() {
 
     // Reset.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => FALSE,
-      'post comments' => FALSE,
-      'skip comment approval' => FALSE,
+      'access_comments' => FALSE,
+      'post_comments' => FALSE,
+      'skip_comment_approval' => FALSE,
     ));
 
     // Attempt to view comments while disallowed.
@@ -135,9 +135,9 @@ function testAnonymous() {
     $this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
 
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => FALSE,
-      'skip comment approval' => FALSE,
+      'access_comments' => TRUE,
+      'post_comments' => FALSE,
+      'skip_comment_approval' => FALSE,
     ));
     $this->drupalGet('node/' . $this->node->id());
     $this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments were displayed.');
@@ -145,9 +145,9 @@ function testAnonymous() {
     $this->assertLink('register', 1, 'Link to register was found.');
 
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => FALSE,
-      'post comments' => TRUE,
-      'skip comment approval' => TRUE,
+      'access_comments' => FALSE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => TRUE,
     ));
     $this->drupalGet('node/' . $this->node->id());
     $this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
diff --git a/core/modules/comment/src/Tests/CommentBlockTest.php b/core/modules/comment/src/Tests/CommentBlockTest.php
index fc6c1bf..54f16d7 100644
--- a/core/modules/comment/src/Tests/CommentBlockTest.php
+++ b/core/modules/comment/src/Tests/CommentBlockTest.php
@@ -24,15 +24,15 @@ class CommentBlockTest extends CommentTestBase {
 
   protected function setUp() {
     parent::setUp();
-    // Update admin user to have the 'administer blocks' permission.
+    // Update admin user to have the 'administer_blocks' permission.
     $this->admin_user = $this->drupalCreateUser(array(
       'administer content types',
-      'administer comments',
-      'skip comment approval',
-      'post comments',
-      'access comments',
-      'access content',
-      'administer blocks',
+      'administer_comments',
+      'skip_comment_approval',
+      'post_comments',
+      'access_comments',
+      'access_content',
+      'administer_blocks',
      ));
   }
 
@@ -54,15 +54,15 @@ function testRecentCommentBlock() {
       $comments[$i]->save();
     }
 
-    // Test that a user without the 'access comments' permission cannot see the
+    // Test that a user without the 'access_comments' permission cannot see the
     // block.
     $this->drupalLogout();
-    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access comments'));
+    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access_comments'));
     $this->drupalGet('');
     $this->assertNoText(t('Recent comments'));
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_comments'));
 
-    // Test that a user with the 'access comments' permission can see the
+    // Test that a user with the 'access_comments' permission can see the
     // block.
     $this->drupalLogin($this->web_user);
     $this->drupalGet('');
diff --git a/core/modules/comment/src/Tests/CommentBookTest.php b/core/modules/comment/src/Tests/CommentBookTest.php
index 6e324f3..ba08a06 100644
--- a/core/modules/comment/src/Tests/CommentBookTest.php
+++ b/core/modules/comment/src/Tests/CommentBookTest.php
@@ -55,7 +55,7 @@ public function testBookCommentPrint() {
     ));
     $comment->save();
 
-    $commenting_user = $this->drupalCreateUser(array('access printer-friendly version', 'access comments', 'post comments'));
+    $commenting_user = $this->drupalCreateUser(array('access_printer-friendly_version', 'access_comments', 'post_comments'));
     $this->drupalLogin($commenting_user);
 
     $this->drupalGet('node/' . $book_node->id());
diff --git a/core/modules/comment/src/Tests/CommentCSSTest.php b/core/modules/comment/src/Tests/CommentCSSTest.php
index 770502b..4a70940 100644
--- a/core/modules/comment/src/Tests/CommentCSSTest.php
+++ b/core/modules/comment/src/Tests/CommentCSSTest.php
@@ -22,7 +22,7 @@ protected function setUp() {
 
     // Allow anonymous users to see comments.
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments',
+      'access_comments',
       'access content'
     ));
   }
diff --git a/core/modules/comment/src/Tests/CommentCacheTagsTest.php b/core/modules/comment/src/Tests/CommentCacheTagsTest.php
index 5da5555..b850198 100644
--- a/core/modules/comment/src/Tests/CommentCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentCacheTagsTest.php
@@ -34,7 +34,7 @@ protected function setUp() {
     // Give anonymous users permission to view comments, so that we can verify
     // the cache tags of cached versions of comment pages.
     $user_role = Role::load(DRUPAL_ANONYMOUS_RID);
-    $user_role->grantPermission('access comments');
+    $user_role->grantPermission('access_comments');
     $user_role->save();
   }
 
diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
index 8747737f2d..f75f0a5 100644
--- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
@@ -33,10 +33,10 @@ protected function setUp() {
     parent::setUp();
 
     // Set the current user to one that can access comments. Specifically, this
-    // user does not have access to the 'administer comments' permission, to
+    // user does not have access to the 'administer_comments' permission, to
     // ensure only published comments are visible to the end user.
     $current_user = $this->container->get('current_user');
-    $current_user->setAccount($this->createUser(array(), array('access comments')));
+    $current_user->setAccount($this->createUser(array(), array('access_comments')));
 
     // Install tables and config needed to render comments.
     $this->installSchema('comment', array('comment_entity_statistics'));
diff --git a/core/modules/comment/src/Tests/CommentFieldAccessTest.php b/core/modules/comment/src/Tests/CommentFieldAccessTest.php
index ebeada1..55184ec 100644
--- a/core/modules/comment/src/Tests/CommentFieldAccessTest.php
+++ b/core/modules/comment/src/Tests/CommentFieldAccessTest.php
@@ -32,7 +32,7 @@ class CommentFieldAccessTest extends EntityUnitTestBase {
   public static $modules = array('comment', 'entity_test', 'user');
 
   /**
-   * Fields that only users with administer comments permissions can change.
+   * Fields that only users with administer_comments permissions can change.
    *
    * @var array
    */
@@ -102,28 +102,28 @@ public function testAccessToAdministrativeFields() {
     // An administrator user. No user exists yet, ensure that the first user
     // does not have UID 1.
     $comment_admin_user = $this->createUser(['uid' => 2, 'name' => 'admin'], [
-      'administer comments',
-      'access comments',
+      'administer_comments',
+      'access_comments',
     ]);
 
     // Two comment enabled users, one with edit access.
     $comment_enabled_user = $this->createUser(['name' => 'enabled'], [
-      'post comments',
-      'skip comment approval',
-      'edit own comments',
-      'access comments',
+      'post_comments',
+      'skip_comment_approval',
+      'edit_own_comments',
+      'access_comments',
     ]);
     $comment_no_edit_user = $this->createUser(['name' => 'no edit'], [
-      'post comments',
-      'skip comment approval',
-      'access comments',
+      'post_comments',
+      'skip_comment_approval',
+      'access_comments',
     ]);
 
     // An unprivileged user.
-    $comment_disabled_user = $this->createUser(['name' => 'disabled'], ['access content']);
+    $comment_disabled_user = $this->createUser(['name' => 'disabled'], ['access_content']);
 
     $role = Role::load(DRUPAL_ANONYMOUS_RID);
-    $role->grantPermission('post comments')
+    $role->grantPermission('post_comments')
       ->save();
 
     $anonymous_user = new AnonymousUserSession();
@@ -205,13 +205,13 @@ public function testAccessToAdministrativeFields() {
       foreach ($permutations as $set) {
         $may_view = $set['comment']->{$field}->access('view', $set['user']);
         $may_update = $set['comment']->{$field}->access('edit', $set['user']);
-        $this->assertEqual($may_view, $set['user']->hasPermission('administer comments') || ($set['comment']->isPublished() && $set['user']->hasPermission('access comments')), String::format('User @user !state view field !field on comment @comment', [
+        $this->assertEqual($may_view, $set['user']->hasPermission('administer_comments') || ($set['comment']->isPublished() && $set['user']->hasPermission('access_comments')), String::format('User @user !state view field !field on comment @comment', [
           '@user' => $set['user']->getUsername(),
           '!state' => $may_update ? 'can' : 'cannot',
           '@comment' => $set['comment']->getSubject(),
           '!field' => $field,
         ]));
-        $this->assertEqual($may_update, $set['user']->hasPermission('administer comments'), String::format('User @user !state update field !field on comment @comment', [
+        $this->assertEqual($may_update, $set['user']->hasPermission('administer_comments'), String::format('User @user !state update field !field on comment @comment', [
           '@user' => $set['user']->getUsername(),
           '!state' => $may_update ? 'can' : 'cannot',
           '@comment' => $set['comment']->getSubject(),
@@ -223,7 +223,7 @@ public function testAccessToAdministrativeFields() {
     // Check access to normal field.
     foreach ($permutations as $set) {
       $may_update = $set['comment']->access('update', $set['user']) && $set['comment']->subject->access('edit', $set['user']);
-      $this->assertEqual($may_update, $set['user']->hasPermission('administer comments') || ($set['user']->hasPermission('edit own comments') && $set['user']->id() == $set['comment']->getOwnerId()), String::format('User @user !state update field subject on comment @comment', [
+      $this->assertEqual($may_update, $set['user']->hasPermission('administer_comments') || ($set['user']->hasPermission('edit_own_comments') && $set['user']->id() == $set['comment']->getOwnerId()), String::format('User @user !state update field subject on comment @comment', [
         '@user' => $set['user']->getUsername(),
         '!state' => $may_update ? 'can' : 'cannot',
         '@comment' => $set['comment']->getSubject(),
@@ -236,8 +236,8 @@ public function testAccessToAdministrativeFields() {
       foreach ($permutations as $set) {
         $may_view = $set['comment']->{$field}->access('view', $set['user']);
         $may_update = $set['comment']->{$field}->access('edit', $set['user']);
-        $this->assertEqual($may_view, $field != 'hostname' && ($set['user']->hasPermission('administer comments') ||
-            ($set['comment']->isPublished() && $set['user']->hasPermission('access comments'))), String::format('User @user !state view field !field on comment @comment', [
+        $this->assertEqual($may_view, $field != 'hostname' && ($set['user']->hasPermission('administer_comments') ||
+            ($set['comment']->isPublished() && $set['user']->hasPermission('access_comments'))), String::format('User @user !state view field !field on comment @comment', [
           '@user' => $set['user']->getUsername(),
           '!state' => $may_view ? 'can' : 'cannot',
           '@comment' => $set['comment']->getSubject(),
@@ -258,12 +258,12 @@ public function testAccessToAdministrativeFields() {
       foreach ($permutations as $set) {
         $may_update = $set['comment']->{$field}->access('edit', $set['user']);
         // To edit the 'mail' or 'name' field, either the user has the
-        // "administer comments" permissions or the user is anonymous and
+        // "administer_comments" permissions or the user is anonymous and
         // adding a new comment using a field that allows contact details.
-        $this->assertEqual($may_update, $set['user']->hasPermission('administer comments') || (
+        $this->assertEqual($may_update, $set['user']->hasPermission('administer_comments') || (
             $set['user']->isAnonymous() &&
             $set['comment']->isNew() &&
-            $set['user']->hasPermission('post comments') &&
+            $set['user']->hasPermission('post_comments') &&
             $set['comment']->getFieldName() != 'comment_other'
           ), String::format('User @user !state update field !field on comment @comment', [
           '@user' => $set['user']->getUsername(),
@@ -276,7 +276,7 @@ public function testAccessToAdministrativeFields() {
     foreach ($permutations as $set) {
       // Check no view-access to mail field for other than admin.
       $may_view = $set['comment']->mail->access('view', $set['user']);
-      $this->assertEqual($may_view, $set['user']->hasPermission('administer comments'));
+      $this->assertEqual($may_view, $set['user']->hasPermission('administer_comments'));
     }
   }
 
diff --git a/core/modules/comment/src/Tests/CommentFieldsTest.php b/core/modules/comment/src/Tests/CommentFieldsTest.php
index bec1f5a..1f2531f 100644
--- a/core/modules/comment/src/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/src/Tests/CommentFieldsTest.php
@@ -139,7 +139,7 @@ function testCommentInstallAfterContentModule() {
     // Try to post a comment on each node. A failure will be triggered if the
     // comment body is missing on one of these forms, due to postComment()
     // asserting that the body is actually posted correctly.
-    $this->web_user = $this->drupalCreateUser(array('access content', 'access comments', 'post comments', 'skip comment approval'));
+    $this->web_user = $this->drupalCreateUser(array('access content', 'access_comments', 'post_comments', 'skip_comment_approval'));
     $this->drupalLogin($this->web_user);
     $this->postComment($book_node, $this->randomMachineName(), $this->randomMachineName());
   }
diff --git a/core/modules/comment/src/Tests/CommentInterfaceTest.php b/core/modules/comment/src/Tests/CommentInterfaceTest.php
index b174492..273b822 100644
--- a/core/modules/comment/src/Tests/CommentInterfaceTest.php
+++ b/core/modules/comment/src/Tests/CommentInterfaceTest.php
@@ -52,7 +52,7 @@ function testCommentInterface() {
 
     // Comment as anonymous with preview required.
     $this->drupalLogout();
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'access comments', 'post comments', 'skip comment approval'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'access_comments', 'post_comments', 'skip_comment_approval'));
     $anonymous_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
     $this->assertTrue($this->commentExists($anonymous_comment), 'Comment found.');
     $anonymous_comment->delete();
diff --git a/core/modules/comment/src/Tests/CommentLanguageTest.php b/core/modules/comment/src/Tests/CommentLanguageTest.php
index 746aea4..90e8456 100644
--- a/core/modules/comment/src/Tests/CommentLanguageTest.php
+++ b/core/modules/comment/src/Tests/CommentLanguageTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
 
     // Create and login user.
-    $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'administer comments', 'create article content', 'access comments', 'post comments', 'skip comment approval'));
+    $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'administer_comments', 'create article content', 'access_comments', 'post_comments', 'skip_comment_approval'));
     $this->drupalLogin($admin_user);
 
     // Add language.
diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/src/Tests/CommentLinksTest.php
index 34b8b41..ab8940c 100644
--- a/core/modules/comment/src/Tests/CommentLinksTest.php
+++ b/core/modules/comment/src/Tests/CommentLinksTest.php
@@ -83,10 +83,10 @@ public function testCommentLinks() {
 
     // Change user permissions.
     $perms = array(
-      'access comments' => 1,
-      'post comments' => 1,
-      'skip comment approval' => 1,
-      'edit own comments' => 1,
+      'access_comments' => 1,
+      'post_comments' => 1,
+      'skip_comment_approval' => 1,
+      'edit_own_comments' => 1,
     );
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, $perms);
 
diff --git a/core/modules/comment/src/Tests/CommentNodeAccessTest.php b/core/modules/comment/src/Tests/CommentNodeAccessTest.php
index 4c50180..bbcadcb 100644
--- a/core/modules/comment/src/Tests/CommentNodeAccessTest.php
+++ b/core/modules/comment/src/Tests/CommentNodeAccessTest.php
@@ -33,12 +33,12 @@ protected function setUp() {
 
     // Re-create user.
     $this->web_user = $this->drupalCreateUser(array(
-      'access comments',
-      'post comments',
+      'access_comments',
+      'post_comments',
       'create article content',
-      'edit own comments',
+      'edit_own_comments',
       'node test view',
-      'skip comment approval',
+      'skip_comment_approval',
     ));
 
     // Set the author of the created node to the web_user uid.
diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/src/Tests/CommentNonNodeTest.php
index 15eb7b7..0522344 100644
--- a/core/modules/comment/src/Tests/CommentNonNodeTest.php
+++ b/core/modules/comment/src/Tests/CommentNonNodeTest.php
@@ -50,24 +50,24 @@ protected function setUp() {
 
     // Create test user.
     $this->admin_user = $this->drupalCreateUser(array(
-      'administer comments',
-      'skip comment approval',
-      'post comments',
-      'access comments',
+      'administer_comments',
+      'skip_comment_approval',
+      'post_comments',
+      'access_comments',
       'view test entity',
-      'administer entity_test content',
+      'administer_entity_test_content',
     ));
 
     // Enable anonymous and authenticated user comments.
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
     ));
     user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array(
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
     ));
 
     // Create a test entity.
@@ -280,7 +280,7 @@ function testCommentFunctionality() {
     // Check that entity access applies to administrative page.
     $this->assertText($this->entity->label(), 'Name of commented account found.');
     $limited_user = $this->drupalCreateUser(array(
-      'administer comments',
+      'administer_comments',
     ));
     $this->drupalLogin($limited_user);
     $this->drupalGet('admin/content/comment');
@@ -290,9 +290,9 @@ function testCommentFunctionality() {
 
     // Deny anonymous users access to comments.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => FALSE,
-      'post comments' => FALSE,
-      'skip comment approval' => FALSE,
+      'access_comments' => FALSE,
+      'post_comments' => FALSE,
+      'skip_comment_approval' => FALSE,
       'view test entity' => TRUE,
     ));
 
@@ -308,10 +308,10 @@ function testCommentFunctionality() {
     $this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
 
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => FALSE,
+      'access_comments' => TRUE,
+      'post_comments' => FALSE,
       'view test entity' => TRUE,
-      'skip comment approval' => FALSE,
+      'skip_comment_approval' => FALSE,
     ));
     $this->drupalGet('entity_test/' . $this->entity->id());
     $this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments were displayed.');
@@ -324,9 +324,9 @@ function testCommentFunctionality() {
     // comments, to ensure that access to post comments doesn't grant access to
     // view them.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => FALSE,
-      'post comments' => TRUE,
-      'skip comment approval' => TRUE,
+      'access_comments' => FALSE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => TRUE,
       'view test entity' => TRUE,
     ));
     $this->drupalGet('entity_test/' . $this->entity->id());
diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/src/Tests/CommentPreviewTest.php
index 8d188c3..d6cbbcd 100644
--- a/core/modules/comment/src/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/src/Tests/CommentPreviewTest.php
@@ -74,7 +74,7 @@ function testCommentPreview() {
    * Tests comment edit, preview, and save.
    */
   function testCommentEditPreviewSave() {
-    $web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'skip comment approval',  'edit own comments'));
+    $web_user = $this->drupalCreateUser(array('access_comments', 'post_comments', 'skip_comment_approval',  'edit_own_comments'));
     $this->drupalLogin($this->admin_user);
     $this->setCommentPreview(DRUPAL_OPTIONAL);
     $this->setCommentForm(TRUE);
diff --git a/core/modules/comment/src/Tests/CommentStatisticsTest.php b/core/modules/comment/src/Tests/CommentStatisticsTest.php
index 6b7bf01..d36dce4 100644
--- a/core/modules/comment/src/Tests/CommentStatisticsTest.php
+++ b/core/modules/comment/src/Tests/CommentStatisticsTest.php
@@ -22,12 +22,11 @@ protected function setUp() {
 
     // Create a second user to post comments.
     $this->web_user2 = $this->drupalCreateUser(array(
-      'post comments',
+      'post_comments',
       'create article content',
-      'edit own comments',
-      'post comments',
-      'skip comment approval',
-      'access comments',
+      'edit_own_comments',
+      'skip_comment_approval',
+      'access_comments',
       'access content',
     ));
   }
@@ -66,9 +65,9 @@ function testCommentNodeCommentStatistics() {
     // Prepare for anonymous comment submission (comment approval enabled).
     $this->drupalLogin($this->admin_user);
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => TRUE,
-      'skip comment approval' => FALSE,
+      'access_comments' => TRUE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => FALSE,
     ));
     // Ensure that the poster can leave some contact info.
     $this->setCommentAnonymous('1');
@@ -89,9 +88,9 @@ function testCommentNodeCommentStatistics() {
     // Prepare for anonymous comment submission (no approval required).
     $this->drupalLogin($this->admin_user);
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => TRUE,
-      'skip comment approval' => TRUE,
+      'access_comments' => TRUE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => TRUE,
     ));
     $this->drupalLogout();
 
diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php
index d86e3d4..d1b98d4 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -60,21 +60,21 @@ protected function setUp() {
     // Create two test users.
     $this->admin_user = $this->drupalCreateUser(array(
       'administer content types',
-      'administer comments',
-      'administer comment types',
+      'administer_comments',
+      'administer_comment_types',
       'administer comment fields',
       'administer comment display',
-      'skip comment approval',
-      'post comments',
-      'access comments',
+      'skip_comment_approval',
+      'post_comments',
+      'access_comments',
       'access content',
      ));
     $this->web_user = $this->drupalCreateUser(array(
-      'access comments',
-      'post comments',
+      'access_comments',
+      'post_comments',
       'create article content',
-      'edit own comments',
-      'skip comment approval',
+      'edit_own_comments',
+      'skip_comment_approval',
       'access content',
     ));
 
diff --git a/core/modules/comment/src/Tests/CommentTranslationUITest.php b/core/modules/comment/src/Tests/CommentTranslationUITest.php
index 14ea0db..d2390d2 100644
--- a/core/modules/comment/src/Tests/CommentTranslationUITest.php
+++ b/core/modules/comment/src/Tests/CommentTranslationUITest.php
@@ -60,7 +60,7 @@ function setupBundle() {
    * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission().
    */
   protected function getTranslatorPermissions() {
-    return array_merge(parent::getTranslatorPermissions(), array('post comments', 'administer comments', 'access comments'));
+    return array_merge(parent::getTranslatorPermissions(), array('post_comments', 'administer_comments', 'access_comments'));
   }
 
   /**
@@ -117,7 +117,7 @@ protected function getNewEntityValues($langcode) {
   protected function assertPublishedStatus() {
     parent::assertPublishedStatus();
     $entity = entity_load($this->entityTypeId, $this->entityId);
-    $user = $this->drupalCreateUser(array('access comments'));
+    $user = $this->drupalCreateUser(array('access_comments'));
     $this->drupalLogin($user);
     $languages = $this->container->get('language_manager')->getLanguages();
 
@@ -143,7 +143,7 @@ protected function assertPublishedStatus() {
    * Tests translate link on comment content admin page.
    */
   function testTranslateLinkCommentAdminPage() {
-    $this->admin_user = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), array('access administration pages', 'administer comments', 'skip comment approval')));
+    $this->admin_user = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), array('access administration pages', 'administer_comments', 'skip_comment_approval')));
     $this->drupalLogin($this->admin_user);
 
     $cid_translatable = $this->createEntity(array(), $this->langcodes[0]);
diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/src/Tests/CommentTypeTest.php
index 4a6d1b1..e8d1fe9 100644
--- a/core/modules/comment/src/Tests/CommentTypeTest.php
+++ b/core/modules/comment/src/Tests/CommentTypeTest.php
@@ -33,9 +33,9 @@ class CommentTypeTest extends CommentTestBase {
    * @var array
    */
   protected $permissions = array(
-    'administer comments',
+    'administer_comments',
     'administer comment fields',
-    'administer comment types',
+    'administer comment_types',
   );
 
   /**
diff --git a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
index e848ceb..66bf44e 100644
--- a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
+++ b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
@@ -38,7 +38,7 @@ class CommentFieldFilterTest extends CommentTestBase {
 
   function setUp() {
     parent::setUp();
-    $this->drupalLogin($this->drupalCreateUser(['access comments']));
+    $this->drupalLogin($this->drupalCreateUser(['access_comments']));
 
     // Add two new languages.
     ConfigurableLanguage::createFromLangcode('fr')->save();
diff --git a/core/modules/comment/src/Tests/Views/CommentTestBase.php b/core/modules/comment/src/Tests/Views/CommentTestBase.php
index 06500bc..460386b 100644
--- a/core/modules/comment/src/Tests/Views/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/Views/CommentTestBase.php
@@ -36,7 +36,7 @@ protected function setUp() {
 
     // Add two users, create a node with the user1 as author and another node
     // with user2 as author. For the second node add a comment from user1.
-    $this->account = $this->drupalCreateUser(array('skip comment approval'));
+    $this->account = $this->drupalCreateUser(array('skip_comment_approval'));
     $this->account2 = $this->drupalCreateUser();
     $this->drupalLogin($this->account);
 
diff --git a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
index fdcb8f5..1350712 100644
--- a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
@@ -91,11 +91,11 @@ protected function setUp() {
    * @param array $context
    *   Context for the links.
    * @param bool $has_access_comments
-   *   TRUE if the user has 'access comments' permission.
+   *   TRUE if the user has 'access_comments' permission.
    * @param bool $history_exists
    *   TRUE if the history module exists.
    * @param bool $has_post_comments
-   *   TRUE if the use has 'post comments' permission.
+   *   TRUE if the use has 'post_comments' permission.
    * @param bool $is_anonymous
    *   TRUE if the user is anonymous.
    * @param array $expected
@@ -114,8 +114,8 @@ public function testCommentLinkBuilder(NodeInterface $node, $context, $has_acces
     $this->currentUser->expects($this->any())
       ->method('hasPermission')
       ->willReturnMap(array(
-        array('access comments', $has_access_comments),
-        array('post comments', $has_post_comments),
+        array('access_comments', $has_access_comments),
+        array('post_comments', $has_post_comments),
       ));
     $this->currentUser->expects($this->any())
       ->method('isAuthenticated')
diff --git a/core/modules/config/config.permissions.yml b/core/modules/config/config.permissions.yml
index ee24216..c2ecdf6 100644
--- a/core/modules/config/config.permissions.yml
+++ b/core/modules/config/config.permissions.yml
@@ -1,9 +1,9 @@
-synchronize configuration:
+synchronize_configuration:
   title: 'Synchronize configuration'
   restrict access: true
-export configuration:
+export_configuration:
   title: 'Export configuration'
   restrict access: true
-import configuration:
+import_configuration:
   title: 'Import configuration'
   restrict access: true
diff --git a/core/modules/config/config.routing.yml b/core/modules/config/config.routing.yml
index 0fdb30b..440c04b 100644
--- a/core/modules/config/config.routing.yml
+++ b/core/modules/config/config.routing.yml
@@ -4,7 +4,7 @@ config.sync:
     _form: '\Drupal\config\Form\ConfigSync'
     _title: 'Synchronize'
   requirements:
-    _permission: 'synchronize configuration'
+    _permission: 'synchronize_configuration'
 
 config.diff:
   path: '/admin/config/development/configuration/sync/diff/{source_name}/{target_name}'
@@ -12,7 +12,7 @@ config.diff:
     _content: '\Drupal\config\Controller\ConfigController::diff'
     target_name: NULL
   requirements:
-    _permission: 'synchronize configuration'
+    _permission: 'synchronize_configuration'
 
 config.diff_collection:
   path: '/admin/config/development/configuration/sync/diff_collection/{collection}/{source_name}/{target_name}'
@@ -20,14 +20,14 @@ config.diff_collection:
     _content: '\Drupal\config\Controller\ConfigController::diff'
     target_name: NULL
   requirements:
-    _permission: 'synchronize configuration'
+    _permission: 'synchronize_configuration'
 
 config.export_download:
   path: '/admin/config/development/configuration/full/export-download'
   defaults:
     _controller: '\Drupal\config\Controller\ConfigController::downloadExport'
   requirements:
-    _permission: 'export configuration'
+    _permission: 'export_configuration'
 
 config.export_full:
   path: '/admin/config/development/configuration/full/export'
@@ -35,7 +35,7 @@ config.export_full:
     _form: '\Drupal\config\Form\ConfigExportForm'
     _title: 'Export'
   requirements:
-    _permission: 'export configuration'
+    _permission: 'export_configuration'
 
 config.import_full:
   path: '/admin/config/development/configuration/full/import'
@@ -43,7 +43,7 @@ config.import_full:
     _form: '\Drupal\config\Form\ConfigImportForm'
     _title: 'Import'
   requirements:
-    _permission: 'import configuration'
+    _permission: 'import_configuration'
 
 config.import_single:
   path: '/admin/config/development/configuration/single/import'
@@ -51,7 +51,7 @@ config.import_single:
     _title: 'Single import'
     _form: '\Drupal\config\Form\ConfigSingleImportForm'
   requirements:
-    _permission: 'import configuration'
+    _permission: 'import_configuration'
 
 config.export_single:
   path: '/admin/config/development/configuration/single/export/{config_type}/{config_name}'
@@ -61,4 +61,4 @@ config.export_single:
     config_type: NULL
     config_name: NULL
   requirements:
-    _permission: 'export configuration'
+    _permission: 'export_configuration'
diff --git a/core/modules/config/src/Tests/ConfigExportUITest.php b/core/modules/config/src/Tests/ConfigExportUITest.php
index fe3ae8d..15b542f 100644
--- a/core/modules/config/src/Tests/ConfigExportUITest.php
+++ b/core/modules/config/src/Tests/ConfigExportUITest.php
@@ -31,7 +31,7 @@ class ConfigExportUITest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->drupalLogin($this->drupalCreateUser(array('export configuration')));
+    $this->drupalLogin($this->drupalCreateUser(array('export_configuration')));
   }
 
   /**
diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php
index bc801c3..39ce4d7 100644
--- a/core/modules/config/src/Tests/ConfigImportAllTest.php
+++ b/core/modules/config/src/Tests/ConfigImportAllTest.php
@@ -32,7 +32,7 @@ class ConfigImportAllTest extends ModuleTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->web_user = $this->drupalCreateUser(array('synchronize configuration'));
+    $this->web_user = $this->drupalCreateUser(array('synchronize_configuration'));
     $this->drupalLogin($this->web_user);
   }
 
diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php
index e2e2118..ef8455f 100644
--- a/core/modules/config/src/Tests/ConfigImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigImportUITest.php
@@ -25,7 +25,7 @@ class ConfigImportUITest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->web_user = $this->drupalCreateUser(array('synchronize configuration'));
+    $this->web_user = $this->drupalCreateUser(array('synchronize_configuration'));
     $this->drupalLogin($this->web_user);
     $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
   }
diff --git a/core/modules/config/src/Tests/ConfigImportUploadTest.php b/core/modules/config/src/Tests/ConfigImportUploadTest.php
index 9f453c2..d73e5cc 100644
--- a/core/modules/config/src/Tests/ConfigImportUploadTest.php
+++ b/core/modules/config/src/Tests/ConfigImportUploadTest.php
@@ -21,7 +21,7 @@ class ConfigImportUploadTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->web_user = $this->drupalCreateUser(array('import configuration'));
+    $this->web_user = $this->drupalCreateUser(array('import_configuration'));
     $this->drupalLogin($this->web_user);
   }
 
diff --git a/core/modules/config/src/Tests/ConfigSingleImportExportTest.php b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php
index 7221be4..110a7dd 100644
--- a/core/modules/config/src/Tests/ConfigSingleImportExportTest.php
+++ b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php
@@ -31,7 +31,7 @@ public function testImport() {
     $storage = \Drupal::entityManager()->getStorage('config_test');
     $uuid = \Drupal::service('uuid');
 
-    $this->drupalLogin($this->drupalCreateUser(array('import configuration')));
+    $this->drupalLogin($this->drupalCreateUser(array('import_configuration')));
     $import = <<<EOD
 label: First
 weight: 0
@@ -124,7 +124,7 @@ public function testImport() {
    * Tests importing a simple configuration file.
    */
   public function testImportSimpleConfiguration() {
-    $this->drupalLogin($this->drupalCreateUser(array('import configuration')));
+    $this->drupalLogin($this->drupalCreateUser(array('import_configuration')));
     $config = \Drupal::config('system.site')->set('name', 'Test simple import');
     $edit = array(
       'config_type' => 'system.simple',
@@ -142,7 +142,7 @@ public function testImportSimpleConfiguration() {
    * Tests exporting a single configuration file.
    */
   public function testExport() {
-    $this->drupalLogin($this->drupalCreateUser(array('export configuration')));
+    $this->drupalLogin($this->drupalCreateUser(array('export_configuration')));
 
     $this->drupalGet('admin/config/development/configuration/single/export/system.simple');
     $this->assertFieldByXPath('//select[@name="config_type"]//option[@selected="selected"]', t('Simple configuration'), 'The simple configuration option is selected when specified in the URL.');
diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module
index 32b3307..e8b06f4 100644
--- a/core/modules/config_translation/config_translation.module
+++ b/core/modules/config_translation/config_translation.module
@@ -158,7 +158,7 @@ function config_translation_entity_operation(EntityInterface $entity) {
   $entity_type = $entity->getEntityType();
   if ($entity_type->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface') &&
     $entity->hasLinkTemplate('drupal:config-translation-overview') &&
-    \Drupal::currentUser()->hasPermission('translate configuration')) {
+    \Drupal::currentUser()->hasPermission('translate_configuration')) {
     $operations['translate'] = array(
       'title' => t('Translate'),
       'weight' => 50,
diff --git a/core/modules/config_translation/config_translation.permissions.yml b/core/modules/config_translation/config_translation.permissions.yml
index bbba883..7279c68 100644
--- a/core/modules/config_translation/config_translation.permissions.yml
+++ b/core/modules/config_translation/config_translation.permissions.yml
@@ -1,3 +1,3 @@
-translate configuration:
+translate_configuration:
   title: 'Translate user edited configuration'
   description: 'Translate any configuration not shipped with modules and themes.'
diff --git a/core/modules/config_translation/config_translation.routing.yml b/core/modules/config_translation/config_translation.routing.yml
index a7d97fd..e765949 100644
--- a/core/modules/config_translation/config_translation.routing.yml
+++ b/core/modules/config_translation/config_translation.routing.yml
@@ -4,11 +4,11 @@ config_translation.mapper_list:
     _title: 'Configuration translation'
     _content: '\Drupal\config_translation\Controller\ConfigTranslationMapperList::render'
   requirements:
-    _permission: 'translate configuration'
+    _permission: 'translate_configuration'
 
 config_translation.entity_list:
   path: '/admin/config/regional/config-translation/{mapper_id}'
   defaults:
     _content: '\Drupal\config_translation\Controller\ConfigTranslationListController::listing'
   requirements:
-    _permission: 'translate configuration'
+    _permission: 'translate_configuration'
diff --git a/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php b/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php
index 2669778..88d2ec0 100644
--- a/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php
+++ b/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php
@@ -72,7 +72,7 @@ public function access(Route $route, AccountInterface $account) {
     // language is not locked if it is present.
     $source_language_access = is_null($this->sourceLanguage) || !$this->sourceLanguage->isLocked();
     $access =
-      $account->hasPermission('translate configuration') &&
+      $account->hasPermission('translate_configuration') &&
       $mapper->hasSchema() &&
       $mapper->hasTranslatable() &&
       $source_language_access;
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
index 3d7c0c3..27124af 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
@@ -51,9 +51,9 @@ protected function setUp() {
     parent::setUp();
 
     $permissions = array(
-      'access site-wide contact form',
-      'administer blocks',
-      'administer contact forms',
+      'access_site-wide_contact_form',
+      'administer_blocks',
+      'administer_contact_forms',
       'administer content types',
       'administer block_content fields',
       'administer filters',
@@ -67,7 +67,7 @@ protected function setUp() {
       'administer languages',
       'administer image styles',
       'administer responsive images',
-      'translate configuration',
+      'translate_configuration',
     );
 
     // Create and log in user.
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
index 2864317..8041f37 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
@@ -42,11 +42,11 @@ class ConfigTranslationOverviewTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
     $permissions = array(
-      'translate configuration',
+      'translate_configuration',
       'administer languages',
       'administer site configuration',
-      'administer contact forms',
-      'access site-wide contact form',
+      'administer_contact_forms',
+      'access_site-wide_contact_form',
       'access contextual links',
       'administer views',
     );
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
index bb8d359..185682f 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
@@ -60,15 +60,15 @@ class ConfigTranslationUiTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
     $translator_permissions = array(
-      'translate configuration',
+      'translate_configuration',
     );
     $admin_permissions = array_merge(
       $translator_permissions,
       array(
         'administer languages',
         'administer site configuration',
-        'administer contact forms',
-        'access site-wide contact form',
+        'administer_contact_forms',
+        'access_site-wide_contact_form',
         'access contextual links',
         'administer views',
       )
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiThemeTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiThemeTest.php
index 7aa8205..7cca5e1 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationUiThemeTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiThemeTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
       'administer themes',
       'administer languages',
       'administer site configuration',
-      'translate configuration',
+      'translate_configuration',
     );
     // Create and login user.
     $this->admin_user = $this->drupalCreateUser($admin_permissions);
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationViewListUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationViewListUiTest.php
index 2b67abc..92ea1d2 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationViewListUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationViewListUiTest.php
@@ -35,7 +35,7 @@ protected function setUp() {
 
     $permissions = array(
       'administer views',
-      'translate configuration',
+      'translate_configuration',
     );
 
     // Create and log in user.
diff --git a/core/modules/contact/contact.permissions.yml b/core/modules/contact/contact.permissions.yml
index c04534d..c28e431 100644
--- a/core/modules/contact/contact.permissions.yml
+++ b/core/modules/contact/contact.permissions.yml
@@ -1,6 +1,6 @@
-administer contact forms:
+administer_contact_forms:
   title: 'Administer contact forms and contact form settings'
-access site-wide contact form:
+access_site-wide_contact_form:
   title: 'Use the site-wide contact form'
-access user contact forms:
+access_user_contact_forms:
   title: 'Use users'' personal contact forms'
diff --git a/core/modules/contact/contact.routing.yml b/core/modules/contact/contact.routing.yml
index 7eb0739..28b5d60 100644
--- a/core/modules/contact/contact.routing.yml
+++ b/core/modules/contact/contact.routing.yml
@@ -12,7 +12,7 @@ contact.form_list:
     _entity_list: 'contact_form'
     _title: 'Contact forms'
   requirements:
-    _permission: 'administer contact forms'
+    _permission: 'administer_contact_forms'
 
 contact.form_add:
   path: '/admin/structure/contact/add'
@@ -20,7 +20,7 @@ contact.form_add:
     _entity_form: 'contact_form.add'
     _title: 'Add contact form'
   requirements:
-    _permission: 'administer contact forms'
+    _permission: 'administer_contact_forms'
 
 entity.contact_form.edit_form:
   path: '/admin/structure/contact/manage/{contact_form}'
@@ -37,7 +37,7 @@ contact.site_page:
     _content: '\Drupal\contact\Controller\ContactController::contactSitePage'
     contact_form: NULL
   requirements:
-    _permission: 'access site-wide contact form'
+    _permission: 'access_site-wide_contact_form'
 
 contact.site_page_form:
   path: '/contact/{contact_form}'
diff --git a/core/modules/contact/src/Access/ContactPageAccess.php b/core/modules/contact/src/Access/ContactPageAccess.php
index b0574da..aef0a8c 100644
--- a/core/modules/contact/src/Access/ContactPageAccess.php
+++ b/core/modules/contact/src/Access/ContactPageAccess.php
@@ -95,7 +95,7 @@ public function access(UserInterface $user, AccountInterface $account) {
       return $access;
     }
 
-    return $access->orIf(AccessResult::allowedIfHasPermission($account, 'access user contact forms'));
+    return $access->orIf(AccessResult::allowedIfHasPermission($account, 'access_user_contact_forms'));
   }
 
 }
diff --git a/core/modules/contact/src/ContactFormAccessControlHandler.php b/core/modules/contact/src/ContactFormAccessControlHandler.php
index 3af949a..f243197 100644
--- a/core/modules/contact/src/ContactFormAccessControlHandler.php
+++ b/core/modules/contact/src/ContactFormAccessControlHandler.php
@@ -25,12 +25,12 @@ class ContactFormAccessControlHandler extends EntityAccessControlHandler {
   public function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
     if ($operation == 'view') {
       // Do not allow access personal form via site-wide route.
-      return AccessResult::allowedIf($account->hasPermission('access site-wide contact form') && $entity->id() !== 'personal')->cachePerRole();
+      return AccessResult::allowedIf($account->hasPermission('access_site-wide_contact_form') && $entity->id() !== 'personal')->cachePerRole();
     }
     elseif ($operation == 'delete' || $operation == 'update') {
       // Do not allow the 'personal' form to be deleted, as it's used for
       // the personal contact form.
-      return AccessResult::allowedIf($account->hasPermission('administer contact forms') && $entity->id() !== 'personal')->cachePerRole();
+      return AccessResult::allowedIf($account->hasPermission('administer_contact_forms') && $entity->id() !== 'personal')->cachePerRole();
     }
 
     return parent::checkAccess($entity, $operation, $langcode, $account);
diff --git a/core/modules/contact/src/Controller/ContactController.php b/core/modules/contact/src/Controller/ContactController.php
index cffbf5a..9256afc 100644
--- a/core/modules/contact/src/Controller/ContactController.php
+++ b/core/modules/contact/src/Controller/ContactController.php
@@ -74,7 +74,7 @@ public static function create(ContainerInterface $container) {
    */
   public function contactSitePage(ContactFormInterface $contact_form = NULL) {
     // Check if flood control has been activated for sending emails.
-    if (!$this->currentUser()->hasPermission('administer contact forms')) {
+    if (!$this->currentUser()->hasPermission('administer_contact_forms')) {
       $this->contactFloodControl();
     }
 
@@ -85,7 +85,7 @@ public function contactSitePage(ContactFormInterface $contact_form = NULL) {
         ->load($this->config('contact.settings')->get('default_form'));
       // If there are no forms, do not display the form.
       if (empty($contact_form)) {
-        if ($this->currentUser()->hasPermission('administer contact forms')) {
+        if ($this->currentUser()->hasPermission('administer_contact_forms')) {
           drupal_set_message($this->t('The contact form has not been configured. <a href="@add">Add one or more forms</a> .', array(
             '@add' => $this->url('contact.form_add'))), 'error');
           return array();
@@ -118,7 +118,7 @@ public function contactSitePage(ContactFormInterface $contact_form = NULL) {
    */
   public function contactPersonalPage(UserInterface $user) {
     // Check if flood control has been activated for sending emails.
-    if (!$this->currentUser()->hasPermission('administer contact forms') && !$this->currentUser()->hasPermission('administer users')) {
+    if (!$this->currentUser()->hasPermission('administer_contact_forms') && !$this->currentUser()->hasPermission('administer users')) {
       $this->contactFloodControl();
     }
 
diff --git a/core/modules/contact/src/Entity/ContactForm.php b/core/modules/contact/src/Entity/ContactForm.php
index 2dd7ce3..c1b434b 100644
--- a/core/modules/contact/src/Entity/ContactForm.php
+++ b/core/modules/contact/src/Entity/ContactForm.php
@@ -27,7 +27,7 @@
  *     }
  *   },
  *   config_prefix = "form",
- *   admin_permission = "administer contact forms",
+ *   admin_permission = "administer_contact_forms",
  *   bundle_of = "contact_message",
  *   entity_keys = {
  *     "id" = "id",
diff --git a/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php b/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php
index d88ba5a..4d23796 100644
--- a/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php
+++ b/core/modules/contact/src/Tests/ContactAuthenticatedUserTest.php
@@ -27,7 +27,7 @@ class ContactAuthenticatedUserTest extends WebTestBase {
    * Tests that name and email fields are not present for authenticated users.
    */
   function testContactSiteWideTextfieldsLoggedInTestCase() {
-    $this->drupalLogin($this->drupalCreateUser(array('access site-wide contact form')));
+    $this->drupalLogin($this->drupalCreateUser(array('access_site-wide_contact_form')));
     $this->drupalGet('contact');
 
     // Ensure that there is no textfield for name.
diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php
index 51124c9..b0a5cb5 100644
--- a/core/modules/contact/src/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/src/Tests/ContactPersonalTest.php
@@ -33,7 +33,7 @@ class ContactPersonalTest extends WebTestBase {
   private $admin_user;
 
   /**
-   * A user with 'access user contact forms' permission.
+   * A user with 'access_user_contact_forms' permission.
    *
    * @var object
    */
@@ -50,11 +50,11 @@ protected function setUp() {
     parent::setUp();
 
     // Create an admin user.
-    $this->admin_user = $this->drupalCreateUser(array('administer contact forms', 'administer users', 'administer account settings', 'access site reports'));
+    $this->admin_user = $this->drupalCreateUser(array('administer_contact_forms', 'administer users', 'administer account settings', 'access site reports'));
 
     // Create some normal users with their contact forms enabled by default.
     \Drupal::config('contact.settings')->set('user_default_enabled', TRUE)->save();
-    $this->web_user = $this->drupalCreateUser(array('access user contact forms'));
+    $this->web_user = $this->drupalCreateUser(array('access_user_contact_forms'));
     $this->contact_user = $this->drupalCreateUser();
   }
 
@@ -127,7 +127,7 @@ function testPersonalContactAccess() {
 
     // Test that anonymous users can access the contact form.
     $this->drupalLogout();
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_user_contact_forms'));
     $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
     $this->assertResponse(200);
 
@@ -136,7 +136,7 @@ function testPersonalContactAccess() {
     $this->assertResponse(200);
 
     // Revoke the personal contact permission for the anonymous user.
-    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
+    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access_user_contact_forms'));
     $this->drupalGet('user/' . $this->contact_user->id() . '/contact');
     $this->assertResponse(403);
     $this->drupalGet('user/' . $this->admin_user->id() . '/contact');
@@ -221,7 +221,7 @@ function testPersonalContactFlood() {
    * Tests the personal contact form based access when an admin adds users.
    */
   function testAdminContact() {
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_user_contact_forms'));
     $this->checkContactAccess(200);
     $this->checkContactAccess(403, FALSE);
     $config = \Drupal::config('contact.settings');
diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php
index beee430..0a48095 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -31,8 +31,8 @@ class ContactSitewideTest extends WebTestBase {
   function testSiteWideContact() {
     // Create and login administrative user.
     $admin_user = $this->drupalCreateUser(array(
-      'access site-wide contact form',
-      'administer contact forms',
+      'access_site-wide_contact_form',
+      'administer_contact_forms',
       'administer users',
       'administer account settings',
       'administer contact_message fields',
@@ -76,7 +76,7 @@ function testSiteWideContact() {
     $this->assertNoLinkByHref('admin/structure/contact/manage/feedback');
 
     // Ensure that the contact form won't be shown without forms.
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
     $this->drupalLogout();
     $this->drupalGet('contact');
     $this->assertResponse(404);
@@ -140,7 +140,7 @@ function testSiteWideContact() {
     \Drupal::config('contact.settings')->set('default_form', $id)->save();
 
     // Ensure that the contact form is shown without a form selection input.
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
     $this->drupalLogout();
     $this->drupalGet('contact');
     $this->assertText(t('Your email address'));
@@ -166,12 +166,12 @@ function testSiteWideContact() {
     $this->drupalLogout();
 
     // Check to see that anonymous user cannot see contact page without permission.
-    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
+    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
     $this->drupalGet('contact');
     $this->assertResponse(403);
 
     // Give anonymous user permission and see that page is viewable.
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
     $this->drupalGet('contact');
     $this->assertResponse(200);
 
@@ -277,7 +277,7 @@ function testSiteWideContact() {
    */
   function testAutoReply() {
     // Create and login administrative user.
-    $admin_user = $this->drupalCreateUser(array('access site-wide contact form', 'administer contact forms', 'administer permissions', 'administer users'));
+    $admin_user = $this->drupalCreateUser(array('access_site-wide_contact_form', 'administer_contact_forms', 'administer permissions', 'administer users'));
     $this->drupalLogin($admin_user);
 
     // Set up three forms, 2 with an auto-reply and one without.
@@ -289,7 +289,7 @@ function testAutoReply() {
 
     // Log the current user out in order to test the name and email fields.
     $this->drupalLogout();
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
 
     // Test the auto-reply for form 'foo'.
     $email = $this->randomMachineName(32) . '@example.com';
diff --git a/core/modules/contact/src/Tests/ContactStorageTest.php b/core/modules/contact/src/Tests/ContactStorageTest.php
index 741e6b5..4b699aa 100644
--- a/core/modules/contact/src/Tests/ContactStorageTest.php
+++ b/core/modules/contact/src/Tests/ContactStorageTest.php
@@ -44,8 +44,8 @@ public static function getInfo() {
   public function testContactStorage() {
     // Create and login administrative user.
     $admin_user = $this->drupalCreateUser(array(
-      'access site-wide contact form',
-      'administer contact forms',
+      'access_site-wide_contact_form',
+      'administer_contact_forms',
       'administer users',
       'administer account settings',
       'administer contact_message fields',
@@ -59,7 +59,7 @@ public function testContactStorage() {
     $this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
 
     // Ensure that anonymous can submit site-wide contact form.
-    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
     $this->drupalLogout();
     $this->drupalGet('contact');
     $this->assertText(t('Your email address'));
diff --git a/core/modules/contact/src/Tests/Views/ContactLinkTest.php b/core/modules/contact/src/Tests/Views/ContactLinkTest.php
index bb7fb91..e5ddd1e 100644
--- a/core/modules/contact/src/Tests/Views/ContactLinkTest.php
+++ b/core/modules/contact/src/Tests/Views/ContactLinkTest.php
@@ -64,7 +64,7 @@ public function testContactLink() {
     $accounts['no_contact'] = $no_contact_account;
 
     // Create an account with access to contact pages.
-    $contact_account = $this->drupalCreateUser(array('access user contact forms'));
+    $contact_account = $this->drupalCreateUser(array('access_user_contact_forms'));
     $accounts['contact'] = $contact_account;
 
     $this->drupalLogin($admin_account);
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
index 98ea255..bb9a400 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     $this->container->get('comment.manager')->addDefaultField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
     $this->container->get('comment.manager')->addDefaultField('node', 'page', 'comment_page');
 
-    $admin_user = $this->drupalCreateUser(array('access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer comments', 'administer comment types', 'administer account settings'));
+    $admin_user = $this->drupalCreateUser(array('access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer_comments', 'administer_comment_types', 'administer account settings'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationStandardFieldsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationStandardFieldsTest.php
index 1b0cd31..1244fb8 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationStandardFieldsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationStandardFieldsTest.php
@@ -48,8 +48,8 @@ protected function setUp() {
       'administer content types',
       'administer node fields',
       'administer comment fields',
-      'administer comments',
-      'administer comment types',
+      'administer_comments',
+      'administer_comment_types',
     ));
     $this->drupalLogin($admin_user);
   }
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
index a6edb35..34ebc24 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
@@ -438,7 +438,7 @@ public function testCommentHandler() {
     }
 
     // Test as a non-admin.
-    $normal_user = $this->drupalCreateUser(array('access content', 'access comments'));
+    $normal_user = $this->drupalCreateUser(array('access content', 'access_comments'));
     \Drupal::currentUser()->setAccount($normal_user);
     $referenceable_tests = array(
       array(
@@ -477,7 +477,7 @@ public function testCommentHandler() {
     $this->assertReferenceable($field, $referenceable_tests, 'Comment handler');
 
     // Test as a comment admin.
-    $admin_user = $this->drupalCreateUser(array('access content', 'access comments', 'administer comments'));
+    $admin_user = $this->drupalCreateUser(array('access content', 'access_comments', 'administer_comments'));
     \Drupal::currentUser()->setAccount($admin_user);
     $referenceable_tests = array(
       array(
@@ -495,7 +495,7 @@ public function testCommentHandler() {
     $this->assertReferenceable($field, $referenceable_tests, 'Comment handler (comment admin)');
 
     // Test as a node and comment admin.
-    $admin_user = $this->drupalCreateUser(array('access content', 'access comments', 'administer comments', 'bypass node access'));
+    $admin_user = $this->drupalCreateUser(array('access content', 'access_comments', 'administer_comments', 'bypass node access'));
     \Drupal::currentUser()->setAccount($admin_user);
     $referenceable_tests = array(
       array(
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
index 939cfc4..b92426b 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
@@ -28,7 +28,7 @@ class FieldImportDeleteUninstallUiTest extends FieldTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->web_user = $this->drupalCreateUser(array('synchronize configuration'));
+    $this->web_user = $this->drupalCreateUser(array('synchronize_configuration'));
     $this->drupalLogin($this->web_user);
   }
 
diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php
index 5cc7ab7..f3b988a 100644
--- a/core/modules/file/src/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php
@@ -237,16 +237,16 @@ function testPrivateFileSetting() {
    * Tests that download restrictions on private files work on comments.
    */
   function testPrivateFileComment() {
-    $user = $this->drupalCreateUser(array('access comments'));
+    $user = $this->drupalCreateUser(array('access_comments'));
 
     // Grant the admin user required comment permissions.
     $roles = $this->admin_user->getRoles();
-    user_role_grant_permissions($roles[1], array('administer comment fields', 'administer comments'));
+    user_role_grant_permissions($roles[1], array('administer comment fields', 'administer_comments'));
 
     // Revoke access comments permission from anon user, grant post to
     // authenticated.
-    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access comments'));
-    user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('post comments', 'skip comment approval'));
+    user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access_comments'));
+    user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('post_comments', 'skip_comment_approval'));
 
     // Create a new field.
     $this->container->get('comment.manager')->addDefaultField('node', 'article');
diff --git a/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php b/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php
index 99d82d3..3d09849 100644
--- a/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php
+++ b/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php
@@ -51,9 +51,9 @@ protected function setUp() {
     // Setup users.
     $this->web_user = $this->drupalCreateUser(array(
       'access content',
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
       $filtered_html_format->getPermissionName(),
     ));
     $this->drupalLogin($this->web_user);
diff --git a/core/modules/forum/src/Tests/ForumBlockTest.php b/core/modules/forum/src/Tests/ForumBlockTest.php
index 78e1c44..4b66e80 100644
--- a/core/modules/forum/src/Tests/ForumBlockTest.php
+++ b/core/modules/forum/src/Tests/ForumBlockTest.php
@@ -35,11 +35,11 @@ protected function setUp() {
     // Create users.
     $this->adminUser = $this->drupalCreateUser(array(
       'access administration pages',
-      'administer blocks',
+      'administer_blocks',
       'administer nodes',
       'create forum content',
-      'post comments',
-      'skip comment approval',
+      'post_comments',
+      'skip_comment_approval',
     ));
   }
 
diff --git a/core/modules/forum/src/Tests/ForumNodeAccessTest.php b/core/modules/forum/src/Tests/ForumNodeAccessTest.php
index 34ddd35..eb29c4c 100644
--- a/core/modules/forum/src/Tests/ForumNodeAccessTest.php
+++ b/core/modules/forum/src/Tests/ForumNodeAccessTest.php
@@ -40,7 +40,7 @@ function testForumNodeAccess() {
     // Create some users.
     $access_user = $this->drupalCreateUser(array('node test view'));
     $no_access_user = $this->drupalCreateUser();
-    $admin_user = $this->drupalCreateUser(array('access administration pages', 'administer modules', 'administer blocks', 'create forum content'));
+    $admin_user = $this->drupalCreateUser(array('access administration pages', 'administer modules', 'administer_blocks', 'create forum content'));
 
     $this->drupalLogin($admin_user);
 
diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php
index 8ebdb81..46d133b 100644
--- a/core/modules/forum/src/Tests/ForumTest.php
+++ b/core/modules/forum/src/Tests/ForumTest.php
@@ -73,12 +73,12 @@ protected function setUp() {
     $this->admin_user = $this->drupalCreateUser(array(
       'access administration pages',
       'administer modules',
-      'administer blocks',
+      'administer_blocks',
       'administer forums',
       'administer menu',
       'administer taxonomy',
       'create forum content',
-      'access comments',
+      'access_comments',
     ));
     $this->edit_any_topics_user = $this->drupalCreateUser(array(
       'access administration pages',
@@ -95,9 +95,9 @@ protected function setUp() {
     $this->post_comment_user = $this->drupalCreateUser(array(
       'administer content types',
       'create forum content',
-      'post comments',
-      'skip comment approval',
-      'access comments',
+      'post_comments',
+      'skip_comment_approval',
+      'access_comments',
     ));
     $this->drupalPlaceBlock('system_help_block', array('region' => 'help'));
   }
@@ -176,7 +176,7 @@ function testForum() {
     $this->assertFieldByXPath($xpath, '6', 'Number of posts found.');
 
     // Test loading multiple forum nodes on the front page.
-    $this->drupalLogin($this->drupalCreateUser(array('administer content types', 'create forum content', 'post comments')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer content types', 'create forum content', 'post_comments')));
     $this->drupalPostForm('admin/structure/types/manage/forum', array('options[promote]' => 'promote'), t('Save content type'));
     $this->createForumTopic($this->forum, FALSE);
     $this->createForumTopic($this->forum, FALSE);
diff --git a/core/modules/forum/src/Tests/Views/ForumIntegrationTest.php b/core/modules/forum/src/Tests/Views/ForumIntegrationTest.php
index de169f6..6ea58b9 100644
--- a/core/modules/forum/src/Tests/Views/ForumIntegrationTest.php
+++ b/core/modules/forum/src/Tests/Views/ForumIntegrationTest.php
@@ -57,7 +57,7 @@ public function testForumIntegration() {
       $nodes[] = $node;
     }
 
-    $account = $this->drupalCreateUser(array('skip comment approval'));
+    $account = $this->drupalCreateUser(array('skip_comment_approval'));
     $this->drupalLogin($account);
 
     $comments = array();
diff --git a/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php b/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
index e1f9cb9..9a400a5 100644
--- a/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
+++ b/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
@@ -19,7 +19,7 @@ class LanguageBlockSettingsVisibilityTest extends WebTestBase {
   public static $modules = array('block', 'language');
 
   public function testUnnecessaryLanguageSettingsVisibility() {
-    $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'administer blocks'));
+    $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'administer_blocks'));
     $this->drupalLogin($admin_user);
     $this->drupalPostForm('admin/config/regional/language/add', array('predefined_langcode' => 'hu'), t('Add language'));
     $this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
diff --git a/core/modules/language/src/Tests/LanguageSwitchingTest.php b/core/modules/language/src/Tests/LanguageSwitchingTest.php
index 16fa5ac..bc5ef83 100644
--- a/core/modules/language/src/Tests/LanguageSwitchingTest.php
+++ b/core/modules/language/src/Tests/LanguageSwitchingTest.php
@@ -28,7 +28,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create and login user.
-    $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer languages', 'access administration pages'));
+    $admin_user = $this->drupalCreateUser(array('administer_blocks', 'administer languages', 'access administration pages'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index 21dd72e..aa15428 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -64,7 +64,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages', 'administer blocks'));
+    $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages', 'administer_blocks'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
index e0c20fc..4343f04 100644
--- a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
   public function testConfigTranslation() {
     // Add custom language.
     $langcode = 'xx';
-    $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface', 'administer modules', 'access site-wide contact form', 'administer contact forms'));
+    $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface', 'administer modules', 'access_site-wide_contact_form', 'administer_contact_forms'));
     $this->drupalLogin($admin_user);
     $name = $this->randomMachineName(16);
     $edit = array(
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index c35d0d1..f905ba2 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -61,7 +61,7 @@ protected function setUp() {
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
 
     // Create users.
-    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content'));
+    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer_blocks', 'administer menu', 'create article content'));
     $this->authenticated_user = $this->drupalCreateUser(array());
   }
 
@@ -493,7 +493,7 @@ function testSystemMenuRename() {
    * Tests that menu items pointing to unpublished nodes are editable.
    */
   function testUnpublishedNodeMenuItem() {
-    $this->drupalLogin($this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content', 'bypass node access')));
+    $this->drupalLogin($this->drupalCreateUser(array('access administration pages', 'administer_blocks', 'administer menu', 'create article content', 'bypass node access')));
     // Create an unpublished node.
     $node = $this->drupalCreateNode(array(
       'type' => 'article',
@@ -515,7 +515,7 @@ function testUnpublishedNodeMenuItem() {
    * Tests the contextual links on a menu block.
    */
   public function testBlockContextualLinks() {
-    $this->drupalLogin($this->drupalCreateUser(array('administer menu', 'access contextual links', 'administer blocks')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer menu', 'access contextual links', 'administer_blocks')));
     $this->addMenuLink();
     $block = $this->drupalPlaceBlock('system_menu_block:tools', array('label' => 'Tools', 'provider' => 'system'));
     $this->drupalGet('test-page');
diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_role.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_role.yml
index f899c8a..42ec95f 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_role.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_role.yml
@@ -24,8 +24,8 @@ process:
       bypass: true
       map:
         'use PHP for block visibility': 'use PHP for settings'
-        'administer site-wide contact form': 'administer contact forms'
-        'post comments without approval': 'skip comment approval'
+        'administer site-wide contact form': 'administer_contact_forms'
+        'post comments without approval': 'skip_comment_approval'
         'edit own blog entries' : 'edit own blog content'
         'edit any blog entry' : 'edit any blog content'
         'delete own blog entries' : 'delete own blog content'
diff --git a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserRole.php b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserRole.php
index 41f5abe..6eea909 100644
--- a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserRole.php
+++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserRole.php
@@ -110,7 +110,7 @@ public static function getData($table) {
         array('pid' => 1, 'rid' => 1, 'perm' => 'migrate test anonymous permission'),
         array('pid' => 2, 'rid' => 2, 'perm' => 'migrate test authenticated permission'),
         array('pid' => 3, 'rid' => 3, 'perm' => 'migrate test role 1 test permission'),
-        array('pid' => 4, 'rid' => 4, 'perm' => 'migrate test role 2 test permission, use PHP for settings, administer contact forms, skip comment approval, edit own blog content, edit any blog content, delete own blog content, delete any blog content, create forum content, delete any forum content, delete own forum content, edit any forum content, edit own forum content, administer nodes'),
+        array('pid' => 4, 'rid' => 4, 'perm' => 'migrate test role 2 test permission, use PHP for settings, administer_contact_forms, skip_comment_approval, edit own blog content, edit any blog content, delete own blog content, delete any blog content, create forum content, delete any forum content, delete own forum content, edit any forum content, edit own forum content, administer nodes'),
       ),
       'role' => array(
         array('rid' => 1, 'name' => 'anonymous user'),
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php
index ec08766..15f2782 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php
@@ -76,8 +76,8 @@ public function testUserRole() {
     $this->assertEqual($migrate_test_role_2->getPermissions(), array(
       'migrate test role 2 test permission',
       'use PHP for settings',
-      'administer contact forms',
-      'skip comment approval',
+      'administer_contact_forms',
+      'skip_comment_approval',
       'edit own blog content',
       'edit any blog content',
       'delete own blog content',
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/RoleTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/d6/RoleTest.php
index 8211e49..89338ad 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/RoleTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/RoleTest.php
@@ -45,9 +45,9 @@ class RoleTest extends MigrateSqlSourceTestCase {
       'rid' => 2,
       'name' => 'authenticated user',
       'permissions' => array(
-        'access comments',
+        'access_comments',
         'access content',
-        'post comments',
+        'post_comments',
         'post comments without approval',
       ),
     ),
@@ -55,9 +55,9 @@ class RoleTest extends MigrateSqlSourceTestCase {
       'rid' => 3,
       'name' => 'administrator',
       'permissions' => array(
-        'access comments',
-        'administer comments',
-        'post comments',
+        'access_comments',
+        'administer_comments',
+        'post_comments',
         'post comments without approval',
         'access content',
         'administer content types',
diff --git a/core/modules/node/src/Tests/NodeAccessPagerTest.php b/core/modules/node/src/Tests/NodeAccessPagerTest.php
index af4140f..dbc8e0d 100644
--- a/core/modules/node/src/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/src/Tests/NodeAccessPagerTest.php
@@ -30,7 +30,7 @@ protected function setUp() {
     node_access_rebuild();
     $this->drupalCreateContentType(array('type' => 'page', 'name' => t('Basic page')));
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
-    $this->web_user = $this->drupalCreateUser(array('access content', 'access comments', 'node test view'));
+    $this->web_user = $this->drupalCreateUser(array('access content', 'access_comments', 'node test view'));
   }
 
   /**
diff --git a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
index 9bc5054..155a0d0 100644
--- a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
+++ b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
@@ -39,7 +39,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create users and test node.
-    $this->adminUser = $this->drupalCreateUser(array('administer content types', 'administer nodes', 'administer blocks'));
+    $this->adminUser = $this->drupalCreateUser(array('administer content types', 'administer nodes', 'administer_blocks'));
     $this->webUser = $this->drupalCreateUser(array('access content', 'create article content'));
   }
 
diff --git a/core/modules/node/src/Tests/NodeSyndicateBlockTest.php b/core/modules/node/src/Tests/NodeSyndicateBlockTest.php
index 8df9147..ede61c5 100644
--- a/core/modules/node/src/Tests/NodeSyndicateBlockTest.php
+++ b/core/modules/node/src/Tests/NodeSyndicateBlockTest.php
@@ -25,7 +25,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create a user and log in.
-    $admin_user = $this->drupalCreateUser(array('administer blocks'));
+    $admin_user = $this->drupalCreateUser(array('administer_blocks'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/node/src/Tests/NodeTitleTest.php b/core/modules/node/src/Tests/NodeTitleTest.php
index d692be5..441232d 100644
--- a/core/modules/node/src/Tests/NodeTitleTest.php
+++ b/core/modules/node/src/Tests/NodeTitleTest.php
@@ -26,7 +26,7 @@ class NodeTitleTest extends NodeTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->admin_user = $this->drupalCreateUser(array('administer nodes', 'create article content', 'create page content', 'post comments'));
+    $this->admin_user = $this->drupalCreateUser(array('administer nodes', 'create article content', 'create page content', 'post_comments'));
     $this->drupalLogin($this->admin_user);
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
   }
diff --git a/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php b/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php
index 75973e0..4aa3359 100644
--- a/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php
+++ b/core/modules/node/src/Tests/NodeTypeRenameConfigImportTest.php
@@ -31,7 +31,7 @@ class NodeTypeRenameConfigImportTest extends WebTestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->web_user = $this->drupalCreateUser(array('synchronize configuration'));
+    $this->web_user = $this->drupalCreateUser(array('synchronize_configuration'));
     $this->drupalLogin($this->web_user);
   }
 
diff --git a/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php b/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php
index 0f8414f..6f6ad22 100644
--- a/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php
+++ b/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php
@@ -29,7 +29,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create test user.
-    $admin_user = $this->drupalCreateUser(array('synchronize configuration', 'access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'bypass node access', 'administer node fields', 'administer node display'));
+    $admin_user = $this->drupalCreateUser(array('synchronize_configuration', 'access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'bypass node access', 'administer node fields', 'administer node display'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index c3fce4f..9ce6f64 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -313,7 +313,7 @@ function rdf_preprocess_node(&$variables) {
   }
 
   // Adds RDFa markup annotating the number of comments a node has.
-  if (\Drupal::moduleHandler()->moduleExists('comment') && \Drupal::currentUser()->hasPermission('access comments')) {
+  if (\Drupal::moduleHandler()->moduleExists('comment') && \Drupal::currentUser()->hasPermission('access_comments')) {
     $comment_count_mapping = $mapping->getPreparedFieldMapping('comment_count');
     if (!empty($comment_count_mapping['properties'])) {
       $fields = array_keys(\Drupal::service('comment.manager')->getFields('node'));
diff --git a/core/modules/rdf/src/Tests/CommentAttributesTest.php b/core/modules/rdf/src/Tests/CommentAttributesTest.php
index 69a5966..e12050d 100644
--- a/core/modules/rdf/src/Tests/CommentAttributesTest.php
+++ b/core/modules/rdf/src/Tests/CommentAttributesTest.php
@@ -30,9 +30,9 @@ protected function setUp() {
 
     // Enables anonymous user comments.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
-      'access comments' => TRUE,
-      'post comments' => TRUE,
-      'skip comment approval' => TRUE,
+      'access_comments' => TRUE,
+      'post_comments' => TRUE,
+      'skip_comment_approval' => TRUE,
     ));
     // Allows anonymous to leave their contact information.
     $this->setCommentAnonymous(COMMENT_ANONYMOUS_MAY_CONTACT);
diff --git a/core/modules/rdf/src/Tests/StandardProfileTest.php b/core/modules/rdf/src/Tests/StandardProfileTest.php
index 29e9804..bd57858 100644
--- a/core/modules/rdf/src/Tests/StandardProfileTest.php
+++ b/core/modules/rdf/src/Tests/StandardProfileTest.php
@@ -109,14 +109,14 @@ protected function setUp() {
     // Create two test users.
     $this->adminUser = $this->drupalCreateUser(array(
       'administer content types',
-      'administer comments',
-      'access comments',
+      'administer_comments',
+      'access_comments',
       'access content',
     ));
     $this->webUser = $this->drupalCreateUser(array(
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
       'access content',
     ));
 
diff --git a/core/modules/search/src/Tests/SearchBlockTest.php b/core/modules/search/src/Tests/SearchBlockTest.php
index cdc7905..52a65e2 100644
--- a/core/modules/search/src/Tests/SearchBlockTest.php
+++ b/core/modules/search/src/Tests/SearchBlockTest.php
@@ -25,7 +25,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create and login user.
-    $admin_user = $this->drupalCreateUser(array('administer blocks', 'search content'));
+    $admin_user = $this->drupalCreateUser(array('administer_blocks', 'search content'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/search/src/Tests/SearchCommentCountToggleTest.php b/core/modules/search/src/Tests/SearchCommentCountToggleTest.php
index 10d7cf1..bb20219 100644
--- a/core/modules/search/src/Tests/SearchCommentCountToggleTest.php
+++ b/core/modules/search/src/Tests/SearchCommentCountToggleTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create searching user.
-    $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'post comments', 'skip comment approval'));
+    $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access_comments', 'post_comments', 'skip_comment_approval'));
 
     // Login with sufficient privileges.
     $this->drupalLogin($this->searching_user);
diff --git a/core/modules/search/src/Tests/SearchCommentTest.php b/core/modules/search/src/Tests/SearchCommentTest.php
index 9fb3938..a4f685c 100644
--- a/core/modules/search/src/Tests/SearchCommentTest.php
+++ b/core/modules/search/src/Tests/SearchCommentTest.php
@@ -45,9 +45,9 @@ protected function setUp() {
       $full_html_format->getPermissionName(),
       'administer permissions',
       'create page content',
-      'post comments',
-      'skip comment approval',
-      'access comments',
+      'post_comments',
+      'skip_comment_approval',
+      'access_comments',
     );
     $this->admin_user = $this->drupalCreateUser($permissions);
     $this->drupalLogin($this->admin_user);
@@ -81,8 +81,8 @@ function testSearchResultsComment() {
     // Allow anonymous users to search content.
     $edit = array(
       DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
-      DRUPAL_ANONYMOUS_RID . '[access comments]' => 1,
-      DRUPAL_ANONYMOUS_RID . '[post comments]' => 1,
+      DRUPAL_ANONYMOUS_RID . '[access_comments]' => 1,
+      DRUPAL_ANONYMOUS_RID . '[post_comments]' => 1,
     );
     $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions'));
 
@@ -201,7 +201,7 @@ function testSearchResultsCommentAccess() {
    */
   function setRolePermissions($rid, $access_comments = FALSE, $search_content = TRUE) {
     $permissions = array(
-      'access comments' => $access_comments,
+      'access_comments' => $access_comments,
       'search content' => $search_content,
     );
     user_role_change_permissions($rid, $permissions);
@@ -247,8 +247,8 @@ function testAddNewComment() {
       'search content',
       'create article content',
       'access content',
-      'post comments',
-      'access comments',
+      'post_comments',
+      'access_comments',
     ));
     $this->drupalLogin($user);
 
diff --git a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
index e7c98c6..e48332d 100644
--- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
@@ -39,7 +39,7 @@ protected function setUp() {
     parent::setUp();
 
     // Login as a user that can create and search content.
-    $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports'));
+    $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer_blocks', 'access site reports'));
     $this->drupalLogin($this->search_user);
 
     // Add a single piece of content and index it.
diff --git a/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php
index 789687f..7200646 100644
--- a/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php
+++ b/core/modules/search/src/Tests/SearchKeywordsConditionsTest.php
@@ -29,7 +29,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create searching user.
-    $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval'));
+    $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access_comments', 'skip_comment_approval'));
     // Login with sufficient privileges.
     $this->drupalLogin($this->searching_user);
   }
diff --git a/core/modules/search/src/Tests/SearchRankingTest.php b/core/modules/search/src/Tests/SearchRankingTest.php
index 669e6c4..7094672 100644
--- a/core/modules/search/src/Tests/SearchRankingTest.php
+++ b/core/modules/search/src/Tests/SearchRankingTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     $this->nodeSearch = entity_load('search_page', 'node_search');
 
     // Login with sufficient privileges.
-    $this->drupalLogin($this->drupalCreateUser(array('post comments', 'skip comment approval', 'create page content', 'administer search')));
+    $this->drupalLogin($this->drupalCreateUser(array('post_comments', 'skip_comment_approval', 'create page content', 'administer search')));
   }
 
   public function testRankings() {
diff --git a/core/modules/statistics/src/Tests/StatisticsTestBase.php b/core/modules/statistics/src/Tests/StatisticsTestBase.php
index 5559ac2..2fda98f 100644
--- a/core/modules/statistics/src/Tests/StatisticsTestBase.php
+++ b/core/modules/statistics/src/Tests/StatisticsTestBase.php
@@ -33,8 +33,8 @@ protected function setUp() {
     $this->blocking_user = $this->drupalCreateUser(array(
       'access administration pages',
       'access site reports',
-      'ban IP addresses',
-      'administer blocks',
+      'ban_IP_addresses',
+      'administer_blocks',
       'administer statistics',
       'administer users',
     ));
diff --git a/core/modules/system/core.api.php b/core/modules/system/core.api.php
index 5983876..d8f9670 100644
--- a/core/modules/system/core.api.php
+++ b/core/modules/system/core.api.php
@@ -594,7 +594,7 @@
  * permissions to them. Here's an example:
  * @code
  * $role = \Drupal\user\Entity\Role::load('authenticated');
- * $role->grantPermission('access comments');
+ * $role->grantPermission('access_comments');
  * $role->save();
  * @endcode
  *
diff --git a/core/modules/system/src/Entity/Action.php b/core/modules/system/src/Entity/Action.php
index a7176db..64bc12e 100644
--- a/core/modules/system/src/Entity/Action.php
+++ b/core/modules/system/src/Entity/Action.php
@@ -20,7 +20,7 @@
  * @ConfigEntityType(
  *   id = "action",
  *   label = @Translation("Action"),
- *   admin_permission = "administer actions",
+ *   admin_permission = "administer_actions",
  *   entity_keys = {
  *     "id" = "id",
  *     "label" = "label"
diff --git a/core/modules/system/src/Tests/Ajax/DialogTest.php b/core/modules/system/src/Tests/Ajax/DialogTest.php
index 867ed11..7ae3f8e 100644
--- a/core/modules/system/src/Tests/Ajax/DialogTest.php
+++ b/core/modules/system/src/Tests/Ajax/DialogTest.php
@@ -25,7 +25,7 @@ class DialogTest extends AjaxTestBase {
    * Test sending non-JS and AJAX requests to open and manipulate modals.
    */
   public function testDialog() {
-    $this->drupalLogin($this->drupalCreateUser(array('administer contact forms')));
+    $this->drupalLogin($this->drupalCreateUser(array('administer_contact_forms')));
     // Ensure the elements render without notices or exceptions.
     $this->drupalGet('ajax-test/dialog');
 
diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php
index 12f7cdc..ad09a76 100644
--- a/core/modules/system/src/Tests/System/AccessDeniedTest.php
+++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php
@@ -29,7 +29,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create an administrative user.
-    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'administer blocks'));
+    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'administer_blocks'));
 
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user profiles'));
     user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access user profiles'));
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php
index 1534675..bf839ab 100644
--- a/core/modules/system/src/Tests/System/ThemeTest.php
+++ b/core/modules/system/src/Tests/System/ThemeTest.php
@@ -30,7 +30,7 @@ protected function setUp() {
 
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
 
-    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks'));
+    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer_blocks'));
     $this->drupalLogin($this->admin_user);
     $this->node = $this->drupalCreateNode();
   }
diff --git a/core/modules/system/tests/upgrade/drupal-7.field_ui.database.php b/core/modules/system/tests/upgrade/drupal-7.field_ui.database.php
index 1487f8b..fdef041 100644
--- a/core/modules/system/tests/upgrade/drupal-7.field_ui.database.php
+++ b/core/modules/system/tests/upgrade/drupal-7.field_ui.database.php
@@ -38,7 +38,7 @@
 ))
 ->values(array(
   'rid' => '5',
-  'permission' => 'administer comments',
+  'permission' => 'administer_comments',
   'module' => 'comment',
 ))
 ->values(array(
diff --git a/core/modules/system/tests/upgrade/drupal-7.roles.database.php b/core/modules/system/tests/upgrade/drupal-7.roles.database.php
index ab84595..b875e8e 100644
--- a/core/modules/system/tests/upgrade/drupal-7.roles.database.php
+++ b/core/modules/system/tests/upgrade/drupal-7.roles.database.php
@@ -43,7 +43,7 @@
 ))
 ->values(array(
   'rid' => '4',
-  'permission' => 'edit own comments',
+  'permission' => 'edit_own_comments',
   'module' => 'comment',
 ))
 ->execute();
diff --git a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php
index d0c0685..6fea807 100644
--- a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php
@@ -69,7 +69,7 @@ protected function setUp() {
       'administer themes',
       'administer nodes',
       'access content overview',
-      'administer blocks',
+      'administer_blocks',
       'administer menu',
       'administer modules',
       'administer permissions',
diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php
index d1896fb..42218bb 100644
--- a/core/modules/tracker/src/Tests/TrackerTest.php
+++ b/core/modules/tracker/src/Tests/TrackerTest.php
@@ -43,7 +43,7 @@ protected function setUp() {
 
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
 
-    $permissions = array('access comments', 'create page content', 'post comments', 'skip comment approval');
+    $permissions = array('access_comments', 'create page content', 'post_comments', 'skip_comment_approval');
     $this->user = $this->drupalCreateUser($permissions);
     $this->other_user = $this->drupalCreateUser($permissions);
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
@@ -117,7 +117,7 @@ function testTrackerUser() {
     $this->assertTitle(t('@name | @site', array('@name' => $this->user->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))), 'The user tracker page has the correct page title.');
 
     // Verify that unpublished comments are removed from the tracker.
-    $admin_user = $this->drupalCreateUser(array('post comments', 'administer comments', 'access user profiles'));
+    $admin_user = $this->drupalCreateUser(array('post_comments', 'administer_comments', 'access user profiles'));
     $this->drupalLogin($admin_user);
     $this->drupalPostForm('comment/1/edit', array('status' => CommentInterface::NOT_PUBLISHED), t('Save'));
     $this->drupalGet('user/' . $this->user->id() . '/activity');
diff --git a/core/modules/tracker/src/Tests/Views/TrackerTestBase.php b/core/modules/tracker/src/Tests/Views/TrackerTestBase.php
index 4b69d9c..14f1a4f 100644
--- a/core/modules/tracker/src/Tests/Views/TrackerTestBase.php
+++ b/core/modules/tracker/src/Tests/Views/TrackerTestBase.php
@@ -39,7 +39,7 @@ protected function setUp() {
     // Add a comment field.
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
 
-    $permissions = array('access comments', 'create page content', 'post comments', 'skip comment approval');
+    $permissions = array('access_comments', 'create page content', 'post_comments', 'skip_comment_approval');
     $account = $this->drupalCreateUser($permissions);
 
     $this->drupalLogin($account);
diff --git a/core/modules/user/src/PermissionHandler.php b/core/modules/user/src/PermissionHandler.php
index 0ec4eee..b586c47 100644
--- a/core/modules/user/src/PermissionHandler.php
+++ b/core/modules/user/src/PermissionHandler.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\StringTranslation\TranslationInterface;
+use Drupal\user\PermissionsException;
 
 /**
  * Provides the available permissions based on yml files.
@@ -149,7 +150,9 @@ protected function buildPermissionsYaml() {
         unset($permissions['permission_callbacks']);
       }
 
-      foreach ($permissions as &$permission) {
+      foreach ($permissions as $permission_name => &$permission) {
+        // Uncomment this line once all the permissions are changed.
+        //$this->checkValidPermissionName($permission_name);
         if (!is_array($permission)) {
           $permission = array(
             'title' => $permission,
@@ -219,4 +222,18 @@ protected function systemRebuildModuleData() {
     return system_rebuild_module_data();
   }
 
+  /**
+   * Checks if a permission name is a valid machine name.
+   *
+   * @param string $name
+   *   A permission name to check.
+   *
+   * @throws PermissionsException
+   */
+  protected function checkValidPermissionName($name) {
+    if (!preg_match('@^' . DRUPAL_PHP_FUNCTION_PATTERN . '$@', $name)) {
+      throw new PermissionsException("Permission '$name' is not a valid machine name.");
+    }
+  }
+
 }
diff --git a/core/modules/user/src/Tests/UserBlocksTest.php b/core/modules/user/src/Tests/UserBlocksTest.php
index b81d038..eb7e545 100644
--- a/core/modules/user/src/Tests/UserBlocksTest.php
+++ b/core/modules/user/src/Tests/UserBlocksTest.php
@@ -33,7 +33,7 @@ class UserBlocksTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->adminUser = $this->drupalCreateUser(array('administer blocks'));
+    $this->adminUser = $this->drupalCreateUser(array('administer_blocks'));
     $this->drupalLogin($this->adminUser);
     $this->drupalPlaceBlock('user_login_block');
     $this->drupalLogout($this->adminUser);
diff --git a/core/modules/user/src/Tests/UserCancelTest.php b/core/modules/user/src/Tests/UserCancelTest.php
index de3d1ae..77dba5c 100644
--- a/core/modules/user/src/Tests/UserCancelTest.php
+++ b/core/modules/user/src/Tests/UserCancelTest.php
@@ -304,7 +304,7 @@ function testUserDelete() {
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
 
     // Create a user.
-    $account = $this->drupalCreateUser(array('cancel account', 'post comments', 'skip comment approval'));
+    $account = $this->drupalCreateUser(array('cancel account', 'post_comments', 'skip_comment_approval'));
     $this->drupalLogin($account);
     // Load real user object.
     $account = user_load($account->id(), TRUE);
diff --git a/core/modules/user/src/Tests/UserPermissionsTest.php b/core/modules/user/src/Tests/UserPermissionsTest.php
index ec7ed23..8bdacc7 100644
--- a/core/modules/user/src/Tests/UserPermissionsTest.php
+++ b/core/modules/user/src/Tests/UserPermissionsTest.php
@@ -85,11 +85,11 @@ function testAdministratorRole() {
     $edit['user_admin_role'] = $this->rid;
     $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
 
-    // Enable aggregator module and ensure the 'administer news feeds'
+    // Enable aggregator module and ensure the 'administer_news_feeds'
     // permission is assigned by default.
     \Drupal::ModuleHandler()->install(array('aggregator'));
 
-    $this->assertTrue($this->admin_user->hasPermission('administer news feeds'), 'The permission was automatically assigned to the administrator role');
+    $this->assertTrue($this->admin_user->hasPermission('administer_news_feeds'), 'The permission was automatically assigned to the administrator role');
   }
 
   /**
diff --git a/core/modules/user/src/Tests/UserPictureTest.php b/core/modules/user/src/Tests/UserPictureTest.php
index 639c382..a101f26 100644
--- a/core/modules/user/src/Tests/UserPictureTest.php
+++ b/core/modules/user/src/Tests/UserPictureTest.php
@@ -35,9 +35,9 @@ protected function setUp() {
 
     $this->web_user = $this->drupalCreateUser(array(
       'access content',
-      'access comments',
-      'post comments',
-      'skip comment approval',
+      'access_comments',
+      'post_comments',
+      'skip_comment_approval',
     ));
   }
 
diff --git a/core/modules/user/src/Tests/UserSignatureTest.php b/core/modules/user/src/Tests/UserSignatureTest.php
index 1eb9af7..f16f592 100644
--- a/core/modules/user/src/Tests/UserSignatureTest.php
+++ b/core/modules/user/src/Tests/UserSignatureTest.php
@@ -60,9 +60,9 @@ protected function setUp() {
     user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array($this->filtered_html_format->getPermissionName()));
 
     // Create regular and administrative users.
-    $this->web_user = $this->drupalCreateUser(array('post comments'));
+    $this->web_user = $this->drupalCreateUser(array('post_comments'));
 
-    $admin_permissions = array('post comments', 'administer comments', 'administer user form display', 'administer account settings');
+    $admin_permissions = array('post_comments', 'administer_comments', 'administer user form display', 'administer account settings');
     foreach (filter_formats() as $format) {
       if ($permission = $format->getPermissionName()) {
         $admin_permissions[] = $permission;
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index c2037de..a8c2f7b 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1206,10 +1206,10 @@ function user_role_load($rid) {
  *   @code
  *     array(
  *       'administer nodes' => 0,                // Revoke 'administer nodes'
- *       'administer blocks' => FALSE,           // Revoke 'administer blocks'
+ *       'administer_blocks' => FALSE,           // Revoke 'administer_blocks'
  *       'access user profiles' => 1,            // Grant 'access user profiles'
  *       'access content' => TRUE,               // Grant 'access content'
- *       'access comments' => 'access comments', // Grant 'access comments'
+ *       'access_comments' => 'access_comments', // Grant 'access_comments'
  *     )
  *   @endcode
  *   Existing permissions are not changed, unless specified in $permissions.
diff --git a/core/modules/views/src/Tests/Plugin/StyleOpmlTest.php b/core/modules/views/src/Tests/Plugin/StyleOpmlTest.php
index 6580c0c..9200fca 100644
--- a/core/modules/views/src/Tests/Plugin/StyleOpmlTest.php
+++ b/core/modules/views/src/Tests/Plugin/StyleOpmlTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
 
     $this->enableViewsTestModule();
 
-    $admin_user = $this->drupalCreateUser(array('administer news feeds'));
+    $admin_user = $this->drupalCreateUser(array('administer_news_feeds'));
     $this->drupalLogin($admin_user);
   }
 
diff --git a/core/modules/views/src/Tests/Wizard/WizardTestBase.php b/core/modules/views/src/Tests/Wizard/WizardTestBase.php
index 0a2e998..9d724b1 100644
--- a/core/modules/views/src/Tests/Wizard/WizardTestBase.php
+++ b/core/modules/views/src/Tests/Wizard/WizardTestBase.php
@@ -25,7 +25,7 @@ protected function setUp() {
     parent::setUp();
 
     // Create and log in a user with administer views permission.
-    $views_admin = $this->drupalCreateUser(array('administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view all revisions'));
+    $views_admin = $this->drupalCreateUser(array('administer views', 'administer_blocks', 'bypass node access', 'access user profiles', 'view all revisions'));
     $this->drupalLogin($views_admin);
   }
 
diff --git a/core/modules/views_ui/src/Tests/UITestBase.php b/core/modules/views_ui/src/Tests/UITestBase.php
index f8cef54..d36ea14 100644
--- a/core/modules/views_ui/src/Tests/UITestBase.php
+++ b/core/modules/views_ui/src/Tests/UITestBase.php
@@ -42,7 +42,7 @@ protected function setUp() {
 
     $this->adminUser = $this->drupalCreateUser(array('administer views'));
 
-    $this->fullAdminUser = $this->drupalCreateUser(array('administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view all revisions'));
+    $this->fullAdminUser = $this->drupalCreateUser(array('administer views', 'administer_blocks', 'bypass node access', 'access user profiles', 'view all revisions'));
     $this->drupalLogin($this->fullAdminUser);
   }
 
diff --git a/core/profiles/standard/src/Tests/StandardTest.php b/core/profiles/standard/src/Tests/StandardTest.php
index 3ba2347..2c5fa0f 100644
--- a/core/profiles/standard/src/Tests/StandardTest.php
+++ b/core/profiles/standard/src/Tests/StandardTest.php
@@ -33,9 +33,9 @@ function testStandard() {
 
     // Test anonymous user can access 'Main navigation' block.
     $admin = $this->drupalCreateUser(array(
-      'administer blocks',
-      'post comments',
-      'skip comment approval',
+      'administer_blocks',
+      'post_comments',
+      'skip_comment_approval',
     ));
     $this->drupalLogin($admin);
     // Configure the block.
diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install
index c2b5582..b329979 100644
--- a/core/profiles/standard/standard.install
+++ b/core/profiles/standard/standard.install
@@ -36,8 +36,8 @@ function standard_install() {
   $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
 
   // Enable default permissions for system roles.
-  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments'));
-  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access comments', 'post comments', 'skip comment approval'));
+  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_comments'));
+  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access_comments', 'post_comments', 'skip_comment_approval'));
 
   // Enable all permissions for the administrator role.
   user_role_grant_permissions('administrator', array_keys(\Drupal::service('user.permissions')->getPermissions()));
@@ -54,8 +54,8 @@ function standard_install() {
   $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
   $menu_link_manager->updateDefinition('contact.site_page', array('enabled' => 1));
 
-  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
-  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access site-wide contact form'));
+  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access_site-wide_contact_form'));
+  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access_site-wide_contact_form'));
 
   // Allow authenticated users to use shortcuts.
   user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access shortcuts'));
