diff --git a/regcode.install b/regcode.install
index bc944be..9d0f521 100644
--- a/regcode.install
+++ b/regcode.install
@@ -76,10 +76,15 @@ function regcode_schema() {
       ],
     ],
     'primary key' => ['rid'],
-    'unique keys' => [
-      'code' => ['code'],
-    ],
   ];
 
   return $schema;
 }
+
+/**
+ * Removes the 'code' field as a unique key on the 'regcode' table.
+ */
+function regcode_update_8101() {
+  $schema = \Drupal::database()->schema();
+  $schema->dropUniqueKey('regcode', 'code');
+}
diff --git a/tests/src/Functional/RegcodeSettingsTest.php b/tests/src/Functional/RegcodeSettingsTest.php
new file mode 100644
index 0000000..20894bb
--- /dev/null
+++ b/tests/src/Functional/RegcodeSettingsTest.php
@@ -0,0 +1,83 @@
+<?php
+
+namespace Drupal\Tests\regcode\Functional;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests operation of the Regcode settings page.
+ *
+ * @group regcode
+ */
+class RegcodeSettingsTest extends BrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = ['regcode', 'help', 'block'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
+  /**
+   * Admin user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $adminUser;
+
+  /**
+   * Authenticated but unprivileged user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $unprivUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp(): void {
+    parent::setUp();
+
+    // System help block is needed to see output from hook_help().
+    $this->drupalPlaceBlock('help_block', ['region' => 'help']);
+
+    // Create our test users.
+    $this->adminUser = $this->createUser([
+      'administer site configuration',
+      'access administration pages',
+      'administer registration codes',
+    ]);
+    $this->unprivUser = $this->createUser();
+  }
+
+  /**
+   * Tests module permissions / access to configuration page.
+   */
+  public function testUserAccess() {
+    /** @var \Drupal\Tests\WebAssert $assert */
+    $assert = $this->assertSession();
+
+    // Test as anonymous user.
+    $this->drupalGet('admin/config/people/regcode/settings');
+    $assert->statusCodeEquals(403);
+    $assert->pageTextContains('Access denied');
+    $assert->pageTextContains('You are not authorized to access this page.');
+
+    // Test as authenticated but unprivileged user.
+    $this->drupalLogin($this->unprivUser);
+    $this->drupalGet('admin/config/people/regcode/settings');
+    $assert->statusCodeEquals(403);
+    $this->drupalLogout();
+
+    // Test as admin user.
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('admin/config/people/regcode/settings');
+    $assert->statusCodeEquals(200);
+    $assert->pageTextContains('Configure the registration code module.');
+    $this->drupalLogout();
+  }
+
+}
