diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
index fb818fc..0437ba2 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
@@ -41,6 +41,7 @@ protected function prepareEntity() {
    */
   public function form(array $form, array &$form_state) {
     $block = $this->entity;
+    $account = $this->currentUser();
 
     if ($this->operation == 'edit') {
       // @todo Remove this once https://drupal.org/node/1981644 is in.
@@ -106,14 +107,14 @@ public function form(array $form, array &$form_state) {
         'js' => array(drupal_get_path('module', 'custom_block') . '/custom_block.js'),
       ),
       '#weight' => 20,
-      '#access' => $block->isNewRevision() || user_access('administer blocks'),
+      '#access' => $block->isNewRevision() || $account->hasPermission('administer blocks'),
     );
 
     $form['revision_information']['revision'] = array(
       '#type' => 'checkbox',
       '#title' => t('Create new revision'),
       '#default_value' => $block->isNewRevision(),
-      '#access' => user_access('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/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php
index 7980f2d..457f827 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Annotation\Translation;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\block\Plugin\Type\BlockManager;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -41,6 +42,13 @@ class CustomBlockBlock extends BlockBase implements ContainerFactoryPluginInterf
   protected $moduleHandler;
 
   /**
+   * The Drupal account to use for checking for access to block.
+   *
+   * @var \Drupal\Core\Session\AccountInterface.
+   */
+  protected $account;
+
+  /**
    * Constructs a new CustomBlockBlock.
    *
    * @param array $configuration
@@ -53,12 +61,15 @@ class CustomBlockBlock extends BlockBase implements ContainerFactoryPluginInterf
    *   The Plugin Block Manager.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface
    *   The Module Handler.
+   * @param \Drupal\Core\Session\AccountInterface $account
+   *   The account for which view access should be checked.
    */
-  public function __construct(array $configuration, $plugin_id, array $plugin_definition, BlockManager $block_manager, ModuleHandlerInterface $module_handler) {
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, BlockManager $block_manager, ModuleHandlerInterface $module_handler, AccountInterface $account) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
 
     $this->blockManager = $block_manager;
     $this->moduleHandler = $module_handler;
+    $this->account = $account;
   }
 
   /**
@@ -70,7 +81,8 @@ public static function create(ContainerInterface $container, array $configuratio
       $plugin_id,
       $plugin_definition,
       $container->get('plugin.manager.block'),
-      $container->get('module_handler')
+      $container->get('module_handler'),
+      $container->get('current_user')
     );
   }
 
@@ -133,7 +145,7 @@ public function build() {
           '%uuid' => $uuid,
           '!url' => url('block/add')
         )),
-        '#access' => user_access('administer blocks')
+        '#access' => $this->account->hasPermission('administer blocks')
       );
     }
   }
diff --git a/core/modules/block/lib/Drupal/block/BlockAccessController.php b/core/modules/block/lib/Drupal/block/BlockAccessController.php
index 2355c00..a82de8b 100644
--- a/core/modules/block/lib/Drupal/block/BlockAccessController.php
+++ b/core/modules/block/lib/Drupal/block/BlockAccessController.php
@@ -58,7 +58,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
    */
   protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
     if ($operation != 'view') {
-      return user_access('administer blocks', $account);
+      return $account->hasPermission('administer blocks');
     }
 
     // Deny access to disabled blocks.
