diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php b/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
index 1bac7f1..f1f408b 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
@@ -74,7 +74,7 @@ public function buildOptionsForm(&$form, &$form_state) {
       '#type' => 'checkboxes',
       '#title' => t('Role'),
       '#default_value' => $this->options['role'],
-      '#options' => array_map('check_plain', $this->getRoles()),
+      '#options' => array_map(array('\Drupal\Component\Utility\String', 'checkPlain'), user_role_names()),
       '#description' => t('Only the checked roles will be able to access this display. Note that users with "access all views" can see any view, regardless of role.'),
     );
   }
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php b/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php
new file mode 100644
index 0000000..9110f90
--- /dev/null
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\user\Tests\Views\AccessRoleUITest.
+ */
+
+namespace Drupal\user\Tests\Views;
+
+use Drupal\views\Tests\ViewTestData;
+use Drupal\views_ui\Tests\UITestBase;
+
+/**
+ * Tests views role access plugin UI.
+ *
+ * @see Drupal\user\Plugin\views\access\Role
+ */
+class AccessRoleUITest extends UITestBase {
+
+  /**
+   * Views used by this test.
+   *
+   * @var array
+   */
+  public static $testViews = array('test_access_role');
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('user', 'user_test_views');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'User: Access role (UI)',
+      'description' => 'Tests views role access plugin UI.',
+      'group' => 'Views module integration',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    ViewTestData::importTestViews(get_class($this), array('user_test_views'));
+  }
+
+  /**
+   * Tests the role access plugin UI.
+   */
+  public function testAccessRoleUI() {
+    $entity_manager = $this->container->get('plugin.manager.entity');
+    $entity_manager->getStorageController('user_role')->create(array('id' => 'custom_role', 'label' => 'Custom role'))->save();
+    $access_url = "admin/structure/views/nojs/display/test_access_role/default/access_options";
+    $this->drupalPost($access_url, array('access_options[role][custom_role]' => 1), t('Apply'));
+    $this->assertResponse(200);
+
+    $this->drupalPost(NULL, array(), t('Save'));
+    $view = $entity_manager->getStorageController('view')->load('test_access_role');
+
+    $display = $view->getDisplay('default');
+    $this->assertEqual($display['display_options']['access']['options']['role'], array('custom_role' => 'custom_role'));
+  }
+
+}
diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_role.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_role.yml
index 870b4bb..fc8efc6 100644
--- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_role.yml
+++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_role.yml
@@ -1,10 +1,16 @@
-base_table: node
+base_table: views_test_data
 core: '8'
 description: ''
 status: '1'
 display:
   default:
     display_options:
+      fields:
+        id:
+          id: id
+          field: id
+          table: views_test_data
+          plugin_id: numeric
       access:
         type: role
       cache:
