This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/main/pr-9498-82224eaca8d2e10a9b077cb1bf406601fdc6ff18
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 1595e320fa315f9d5872cc5b0afb83b721308692
Author: Xinyuan Lin <[email protected]>
AuthorDate: Tue Nov 17 08:47:19 2026 +0000

    feat: honor invite-only at sign-up and add an admin switch (#9498)
    
    ### What changes were proposed in this PR?
    
    `USER_SYS_INVITE_ONLY` now decides the role a new account starts with,
    and admins can switch it on Admin → Settings without a restart.
    
    | A new account, while invite-only is | Before | After |
    | --- | --- | --- |
    | off | INACTIVE; stays on the sign-up page, told to contact an
    administrator; every dashboard request refused | REGULAR; opens the
    dashboard |
    | on | INACTIVE; pending-approval screen | unchanged |
    
    - **Sign-up roles.** These sign-ups start REGULAR while invite-only is
    off, and INACTIVE while it is on:
      - local sign-up, with or without email verification;
      - the first Google or Apple sign-in;
      - a sign-up that claims a dataset-contributor placeholder.
    
    An account from a provider that asserts no email (ORCID) stays INACTIVE
    until it supplies one, and then gets the same role. Staying INACTIVE
    until then is also what lets that step adopt a placeholder. Accounts
    already waiting for approval, and roles an admin set, are never changed.
    - **An admin setting.** Invite-only is now the `invite_only` site
    setting, read on every sign-up. Admin → Settings has a Registration card
    with an Invite Only switch. `USER_SYS_INVITE_ONLY`, now declared in
    `default.conf`, sets its value the first time config-service starts,
    like the page's other settings, and Reset restores it. The value is
    stored as `true` or `false` whatever spelling the variable uses (`yes`,
    `off`, …). `/config/pre-login` reports the stored value to the sign-up
    form. Nothing reads it after sign-in any more, so `/config/user-system`,
    which served only this flag, is removed along with the request the
    frontend made to it on every sign-in. Each sign-up reads the setting
    before it opens its transaction, so a burst of sign-ups cannot have each
    one hold a pooled connection while it waits for a second.
    - **Every boolean default.** The same now holds for every setting
    `default.conf` declares as a boolean: the sidebar tab switches
    (`GUI_TABS_*_ENABLED`) and the reset flag are stored as `true` or
    `false` too. Before, `GUI_TABS_HUB_ENABLED=on` stored `on`, and the
    dashboard and the admin page, which accept only `"true"`, hid the Hub
    tab. A value that is not a boolean now stops config-service at startup,
    as `USER_SYS_INVITE_ONLY` and the reset flag already did. Rows a
    deployment already stored as `on` stay until an admin saves or resets
    that switch.
    - **On by default, and closed when in doubt.** A REGULAR account can run
    code on the server, so opening sign-up has to be a deployment's explicit
    choice. A deployment that never set the variable keeps its new accounts
    INACTIVE, as before. The configured value applies only while no row is
    stored: a read that fails, or a row that is neither true nor false,
    keeps sign-up closed and logs a warning. The admin card likewise shows
    anything but an explicit `false` as on, because Save writes whatever the
    switch shows.
    - **Pending accounts.** Any INACTIVE account gets the pending-approval
    screen when it signs in, whatever the switch says now. So accounts still
    waiting when an admin turns invite-only off are not dropped onto a
    dashboard that refuses every request. The same goes for an account an
    admin deactivated, which before got this screen only on invite-only
    deployments.
    - **Sign-up page.** When the new account is usable, the page says so and
    opens the dashboard. The "contact the administrator" hint and message
    appear only while invite-only is on, or while the account is still
    INACTIVE.
    
    | | Before | After |
    | --- | --- | --- |
    | Admin → Settings | ![Admin settings
    
before](https://raw.githubusercontent.com/aglinxinyuan/texera/d7e48c543320338c4b5c0fff9ead279d6b3df482/admin-settings-before.png)
    | ![Admin settings
    
after](https://raw.githubusercontent.com/aglinxinyuan/texera/d7e48c543320338c4b5c0fff9ead279d6b3df482/admin-settings-after.png)
    |
    | After signing up, invite-only off | ![After sign-up
    
before](https://raw.githubusercontent.com/aglinxinyuan/texera/d7e48c543320338c4b5c0fff9ead279d6b3df482/signup-result-before.png)
    | ![After sign-up
    
after](https://raw.githubusercontent.com/aglinxinyuan/texera/d7e48c543320338c4b5c0fff9ead279d6b3df482/signup-result-after.png)
    |
    
    ### Any related issues, documentation, discussions?
    
    Closes #9497.
    
    ### How was this PR tested?
    
    Unit tests, all passing:
    
    ```
    sbt "DAO/testOnly org.apache.texera.dao.SiteSettingsSpec" "Config/test" 
"Auth/testOnly org.apache.texera.auth.InviteOnlySpec" "ConfigService/test" 
"WorkflowExecutionService/testOnly org.apache.texera.web.resource.auth.*"
    cd frontend && ng test --watch=false 
--include=src/app/common/service/gui-config.service.spec.ts 
--include=src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts
 --include=src/app/hub/component/login/texera-login.component.spec.ts 
--include=src/app/common/service/user/auth.service.spec.ts
    ```
    
    That is 15 SiteSettings, 105 Config, 9 InviteOnly, 43 ConfigService and
    141 amber auth cases, plus 12 GuiConfigService, 62 admin-settings, 64
    login and 39 AuthService cases. The new cases run with invite-only both
    on and off. They cover local sign-up, register/verify, Google and Apple,
    placeholder claims, the add-email step and placeholder adoption, and a
    switch reaching the very next registration. They check that pending
    accounts and admin-set roles are left alone, that a missing row falls
    back to the seed while a failed read or an unreadable row keeps sign-up
    closed, that invite-only, every sidebar tab switch and the reset flag
    are seeded as true or false whatever the spelling (`off`, `no`, `on`,
    `yes`) while a value that is not a boolean is refused, and that a fresh
    deployment seeds invite-only on. They also cover the admin card's load,
    save, reset and its guard against saving before the load, the sign-up
    page's outcomes and hint, the pending screen for an INACTIVE sign-in
    while invite-only is off, and a sign-in that no longer asks for
    `/config/user-system`.
    
    Lint: `scalafmtCheckAll` and `scalafixAll --check` on DAO, Config, Auth,
    ConfigService and WorkflowExecutionService; `prettier-eslint
    --list-different` and `eslint` on the changed frontend files.
    
    Manual check: config-service and the web server ran against a fresh
    database, with `USER_SYS_INVITE_ONLY` unset.
    1. `invite_only` was seeded `true`, and a sign-up came out INACTIVE with
    the Request access dialog.
    2. After turning the switch off on Admin → Settings, with no restart,
    the next sign-up was REGULAR and opened the dashboard.
    3. After turning it back on, the next sign-up was INACTIVE again.
    4. After the second review round, signing in requested `/config/gui` and
    `/config/amber` but not `/config/user-system`, which now answers 404,
    and the sign-up form still told new accounts to ask for activation.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Code (Claude Opus 5.5)
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
 .../texera/web/resource/auth/AuthResource.scala    |  43 +++++--
 .../resource/auth/ExternalAuthProvisioner.scala    |  12 +-
 .../web/resource/auth/AppleAuthResourceSpec.scala  |  16 ++-
 .../web/resource/auth/AuthResourceSpec.scala       | 125 ++++++++++++++++++++-
 .../auth/ExternalAuthProvisionerSpec.scala         |  84 +++++++++++++-
 .../web/resource/auth/GoogleAuthResourceSpec.scala |  16 ++-
 bin/k8s/values-development.yaml                    |   2 +
 bin/k8s/values.yaml                                |   2 +
 .../scala/org/apache/texera/auth/InviteOnly.scala  |  59 ++++++++++
 .../org/apache/texera/auth/InviteOnlySpec.scala    | 115 +++++++++++++++++++
 common/config/src/main/resources/default.conf      |  14 +++
 common/config/src/main/resources/user-system.conf  |   4 +-
 .../texera/common/config/DefaultsConfig.scala      |  62 ++++++++--
 .../texera/common/config/UserSystemConfig.scala    |   1 -
 .../texera/common/config/DefaultsConfigSpec.scala  |  52 +++++++++
 .../common/config/UserSystemConfigSpec.scala       |   1 -
 .../scala/org/apache/texera/dao/SiteSettings.scala |  40 ++++---
 .../org/apache/texera/dao/SiteSettingsSpec.scala   |  32 ++++++
 .../texera/service/resource/ConfigResource.scala   |  17 +--
 .../service/resource/ConfigResourceSpec.scala      |  48 +++++---
 .../guide-for-developers.md                        |   6 +-
 .../app/common/service/gui-config.service.spec.ts  |  51 ++++-----
 .../src/app/common/service/gui-config.service.ts   |  18 ++-
 .../app/common/service/user/auth.service.spec.ts   |  23 ++++
 .../src/app/common/service/user/auth.service.ts    |   5 +-
 .../app/common/service/user/user.service.spec.ts   |   4 +-
 .../src/app/common/service/user/user.service.ts    |   7 +-
 .../admin/settings/admin-settings.component.html   |  27 +++++
 .../settings/admin-settings.component.spec.ts      | 111 +++++++++++++++++-
 .../admin/settings/admin-settings.component.ts     |  34 ++++++
 .../component/login/texera-login.component.html    |   5 +-
 .../component/login/texera-login.component.spec.ts |  87 +++++++++++++-
 .../hub/component/login/texera-login.component.ts  |  36 ++++--
 33 files changed, 1015 insertions(+), 144 deletions(-)

diff --git 
a/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala 
b/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala
index 3d3f4a49a6..d85efcca39 100644
--- 
a/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala
+++ 
b/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala
@@ -22,7 +22,7 @@ package org.apache.texera.web.resource.auth
 import com.typesafe.scalalogging.Logger
 import io.dropwizard.auth.Auth
 import org.apache.texera.auth.JwtAuth.{jwtClaims, jwtToken}
-import org.apache.texera.auth.SessionUser
+import org.apache.texera.auth.{InviteOnly, SessionUser}
 import org.apache.texera.common.config.UserSystemConfig
 import org.apache.texera.common.util.EmailUtil
 import org.apache.texera.dao.SqlServer
@@ -110,12 +110,32 @@ object AuthResource {
       .where(DSL.lower(USER.EMAIL).eq(EmailUtil.normalize(email)))
       .fetchOneInto(classOf[User])
 
+  /**
+    * The role a sign-up starts with: INACTIVE, waiting for an admin's 
approval, while invite-only
+    * is on, and REGULAR, usable at once, while it is off. Read on every call, 
so a switch on the
+    * admin settings page applies to the next sign-up.
+    *
+    * Callers read it before opening a transaction: the read borrows its own 
pooled connection, and
+    * holding one connection while waiting for another is how a burst of 
sign-ups drains the pool.
+    */
+  def newAccountRole(): UserRoleEnum =
+    if (InviteOnly.enabled) UserRoleEnum.INACTIVE else UserRoleEnum.REGULAR
+
+  /**
+    * Give an account that is finishing its sign-up the role sign-ups start 
with. Only INACTIVE is
+    * replaced: every sign-up starts there, and any other role was set by an 
admin.
+    */
+  private[auth] def admit(user: User, startingRole: UserRoleEnum): Unit =
+    if (user.getRole == UserRoleEnum.INACTIVE) user.setRole(startingRole)
+
   /**
     * Marks a placeholder account (auto-created for a dataset contributor) as
-    * claimed, leaving persistence to the caller.
+    * claimed, leaving persistence to the caller. Claiming is how the 
placeholder's owner signs
+    * up, so the account is admitted with `startingRole` (see 
[[newAccountRole]]).
     */
-  def claimPlaceholder(user: User): Unit = {
+  def claimPlaceholder(user: User, startingRole: UserRoleEnum): Unit = {
     user.setIsPlaceholder(false)
+    admit(user, startingRole)
     val claimedAt = Instant.now().truncatedTo(ChronoUnit.SECONDS)
     user.setComment(
       Option(user.getComment).map(_ + "; ").getOrElse("") +
@@ -203,6 +223,11 @@ class AuthResource {
       )
     }
 
+    // An account from a provider that asserts no address is created INACTIVE 
whatever the
+    // invite-only switch says, because it is inert until it has one. 
Supplying the address is
+    // where that sign-up finishes, so this is where it is admitted.
+    val startingRole = newAccountRole()
+
     val user = 
SqlServer.withTransaction(SqlServer.getInstance().createDSLContext()) { ctx =>
       val txUserDao = new UserDao(ctx.configuration())
 
@@ -220,11 +245,12 @@ class AuthResource {
       Option(fetchUserByEmailIgnoreCase(ctx, email)) match {
         case None =>
           current.setEmail(email)
+          admit(current, startingRole)
           txUserDao.update(current)
           current
 
         case Some(existing) if existing.getIsPlaceholder =>
-          adoptPlaceholder(ctx, txUserDao, current, existing)
+          adoptPlaceholder(ctx, txUserDao, current, existing, startingRole)
 
         case Some(_) =>
           throw new WebApplicationException(
@@ -254,7 +280,8 @@ class AuthResource {
       ctx: DSLContext,
       txUserDao: UserDao,
       current: User,
-      placeholder: User
+      placeholder: User,
+      startingRole: UserRoleEnum
   ): User = {
     val callerIsEmpty = current.getRole == UserRoleEnum.INACTIVE
     val placeholderHasCredential = ctx.fetchExists(
@@ -276,7 +303,7 @@ class AuthResource {
     // The caller's display name is their own, so it wins over the one whoever 
listed them as a
     // contributor typed.
     placeholder.setName(current.getName)
-    claimPlaceholder(placeholder)
+    claimPlaceholder(placeholder, startingRole)
     txUserDao.update(placeholder)
 
     // This FK has no ON DELETE CASCADE, so the row has to go before the 
account it points at.
@@ -370,7 +397,7 @@ class AuthResource {
 
     if (!usernameExists && emailExists && existingByEmail.getIsPlaceholder) {
       existingByEmail.setName(username)
-      claimPlaceholder(existingByEmail)
+      claimPlaceholder(existingByEmail, newAccountRole())
       LocalAuthProvisioner.claimWithLocalCredential(existingByEmail, username, 
userpassword)
       return jwtToken(jwtClaims(existingByEmail))
     }
@@ -384,7 +411,7 @@ class AuthResource {
         val user = new User
         user.setName(username)
         user.setEmail(useremail)
-        user.setRole(UserRoleEnum.INACTIVE)
+        user.setRole(newAccountRole())
         // Reports losing the race to a concurrent registration of the same 
handle as a 409.
         LocalAuthProvisioner.createLocalAccount(user, username, userpassword)
         jwtToken(jwtClaims(user))
diff --git 
a/amber/src/main/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisioner.scala
 
b/amber/src/main/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisioner.scala
index a627e80a33..6378ca159b 100644
--- 
a/amber/src/main/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisioner.scala
+++ 
b/amber/src/main/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisioner.scala
@@ -130,6 +130,9 @@ object ExternalAuthProvisioner extends LazyLogging {
   }
 
   private def provision(profile: Asserted): User = {
+    // Read before the transaction opens, as `AuthResource.newAccountRole` 
asks.
+    val startingRole = AuthResource.newAccountRole()
+
     SqlServer.withTransaction(SqlServer.getInstance().createDSLContext()) { 
ctx =>
       val txUserDao = new UserDao(ctx.configuration())
       val txAuthDao = new AuthProviderDao(ctx.configuration())
@@ -158,7 +161,7 @@ object ExternalAuthProvisioner extends LazyLogging {
             case Some(existing) =>
               existing.tap { user =>
                 val wasPlaceholder = user.getIsPlaceholder
-                if (wasPlaceholder) AuthResource.claimPlaceholder(user)
+                if (wasPlaceholder) AuthResource.claimPlaceholder(user, 
startingRole)
                 val drifted = refresh(user, profile)
                 if (drifted || wasPlaceholder) txUserDao.update(user)
               }
@@ -169,7 +172,12 @@ object ExternalAuthProvisioner extends LazyLogging {
               // index tolerates repeated NULLs, so several such accounts can 
coexist.
               profile.email.foreach(created.setEmail)
               profile.avatar.foreach(created.setAvatar)
-              created.setRole(UserRoleEnum.INACTIVE)
+              // Without an address the account is inert, so it starts 
INACTIVE whatever the
+              // invite-only switch says; `AuthResource.setEmail` admits it 
once it has one. An
+              // INACTIVE caller is also what lets that call hand it a 
contributor placeholder.
+              created.setRole(
+                if (profile.email.isDefined) startingRole else 
UserRoleEnum.INACTIVE
+              )
               txUserDao.insert(created)
               created
           }
diff --git 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/AppleAuthResourceSpec.scala
 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/AppleAuthResourceSpec.scala
index 43e39b5d3a..0f9fa7692b 100644
--- 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/AppleAuthResourceSpec.scala
+++ 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/AppleAuthResourceSpec.scala
@@ -19,9 +19,10 @@
 
 package org.apache.texera.web.resource.auth
 
+import org.apache.texera.auth.InviteOnly
 import org.apache.texera.common.config.UserSystemConfig
-import org.apache.texera.dao.MockTexeraDB
-import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, USER}
+import org.apache.texera.dao.{MockTexeraDB, SiteSettings}
+import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, 
SITE_SETTINGS, USER}
 import org.apache.texera.dao.jooq.generated.enums.{ProviderTypeEnum, 
UserRoleEnum}
 import org.apache.texera.dao.jooq.generated.tables.daos.UserDao
 import org.apache.texera.dao.jooq.generated.tables.pojos.User
@@ -64,11 +65,16 @@ class AppleAuthResourceSpec
 
   // Identity-only accounts have a NULL email, so they are matched by the name 
they are given
   // instead — the Apple `sub`. AUTH_PROVIDER cascades on delete.
-  private def cleanup(): Unit =
+  private def cleanup(): Unit = {
     getDSLContext
       .deleteFrom(USER)
       .where(USER.EMAIL.like("%" + 
emailDomain).or(USER.NAME.like("apple-sub-%")))
       .execute()
+    getDSLContext
+      .deleteFrom(SITE_SETTINGS)
+      .where(SITE_SETTINGS.KEY.eq(InviteOnly.SettingKey))
+      .execute()
+  }
 
   // ---- helpers -------------------------------------------------------------
 
@@ -113,6 +119,10 @@ class AppleAuthResourceSpec
   behavior of "login"
 
   it should "provision an INACTIVE user and an APPLE provider row on a first 
login" in {
+    // The role follows the admin's invite-only switch 
(ExternalAuthProvisionerSpec covers both
+    // sides); pinned on here so the assertion does not depend on default.conf.
+    SiteSettings.upsert(getDSLContext, InviteOnly.SettingKey, "true", 
"apple-spec-admin")
+
     loginWith(claims("apple-sub-new", "newcomer" + emailDomain))
 
     val user = userByEmail("newcomer")
diff --git 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala
 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala
index d568425cc1..bb86daed24 100644
--- 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala
+++ 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala
@@ -24,10 +24,15 @@ import ch.qos.logback.classic.{Level, Logger => 
LogbackLogger}
 import ch.qos.logback.core.read.ListAppender
 import com.fasterxml.jackson.databind.ObjectMapper
 import io.dropwizard.jersey.errors.LoggingExceptionMapper
-import org.apache.texera.auth.{JwtAuth, SessionUser}
+import org.apache.texera.auth.{InviteOnly, JwtAuth, SessionUser}
 import org.apache.texera.common.config.UserSystemConfig
-import org.apache.texera.dao.MockTexeraDB
-import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, USER, 
USER_LAST_ACTIVE_TIME}
+import org.apache.texera.dao.{MockTexeraDB, SiteSettings}
+import org.apache.texera.dao.jooq.generated.Tables.{
+  AUTH_PROVIDER,
+  SITE_SETTINGS,
+  USER,
+  USER_LAST_ACTIVE_TIME
+}
 import org.apache.texera.dao.jooq.generated.enums.{ProviderTypeEnum, 
UserRoleEnum}
 import org.apache.texera.dao.jooq.generated.tables.daos.{AuthProviderDao, 
UserDao}
 import org.apache.texera.dao.jooq.generated.tables.pojos.{AuthProvider, User}
@@ -114,8 +119,19 @@ class AuthResourceSpec
     
getDSLContext.deleteFrom(USER).where(USER.NAME.startsWith("authspec_")).execute()
     // createAdminUser() seeds the configured admin — remove it too so the 
test starts clean.
     
getDSLContext.deleteFrom(USER).where(USER.NAME.eq(UserSystemConfig.adminUsername)).execute()
+    getDSLContext
+      .deleteFrom(SITE_SETTINGS)
+      .where(SITE_SETTINGS.KEY.eq(InviteOnly.SettingKey))
+      .execute()
   }
 
+  /**
+    * Flip the invite-only switch the way the admin settings page does. 
`cleanup` removes the row,
+    * so a test that depends on the switch sets it rather than inheriting 
default.conf's value.
+    */
+  private def setInviteOnly(on: Boolean): Unit =
+    SiteSettings.upsert(getDSLContext, InviteOnly.SettingKey, on.toString, 
"authspec_admin")
+
   /**
     * Seed a user plus the LOCAL auth_provider row it logs in with, mirroring
     * `LocalAuthProvisioner.createLocalAccount`.
@@ -165,6 +181,10 @@ class AuthResourceSpec
   private def googleIdClaimOf(token: String): AnyRef =
     JwtAuth.jwtConsumer.processToClaims(token).getClaimValue("googleId")
 
+  /** The browser decides between the dashboard and the pending-approval 
screen from this claim. */
+  private def roleClaimOf(token: String): String =
+    
String.valueOf(JwtAuth.jwtConsumer.processToClaims(token).getClaimValue("role"))
+
   /**
     * Runs `body` with a capturing appender on the logger `AuthResource`'s 
companion writes to, and
     * returns the WARN messages it emitted. The level is forced because the 
root logger governs
@@ -249,10 +269,13 @@ class AuthResourceSpec
 
   // ─── register ─────────────────────────────────────────────────────────────
 
-  "register" should "persist an INACTIVE user with a hashed password and issue 
a token" in {
+  "register" should "persist an INACTIVE user with a hashed password and issue 
a token while invite-only is on" in {
+    setInviteOnly(on = true)
+
     val response = resource.register(UserRegistrationRequest(uname("reg"), 
uemail("reg"), "pw"))
 
     subjectOf(response.accessToken) shouldBe uname("reg")
+    roleClaimOf(response.accessToken) shouldBe "INACTIVE"
     val persisted = userDao.fetchByName(uname("reg"))
     persisted.size() shouldBe 1
     val stored = persisted.get(0)
@@ -265,6 +288,29 @@ class AuthResourceSpec
     encryptor.checkPassword("pw", storedPassword) shouldBe true
   }
 
+  // Off means sign-up is open. An INACTIVE account here signs in to a 
dashboard where every request
+  // is refused, because nothing ever shows it the pending-approval screen.
+  it should "persist a REGULAR user and issue a REGULAR token while 
invite-only is off" in {
+    setInviteOnly(on = false)
+
+    val response = resource.register(UserRegistrationRequest(uname("open"), 
uemail("open"), "pw"))
+
+    userDao.fetchByName(uname("open")).get(0).getRole shouldBe 
UserRoleEnum.REGULAR
+    roleClaimOf(response.accessToken) shouldBe "REGULAR"
+  }
+
+  // The switch is edited on the admin settings page, so the next sign-up has 
to see a change without
+  // a restart.
+  it should "apply an invite-only change to the very next registration" in {
+    setInviteOnly(on = true)
+    resource.register(UserRegistrationRequest(uname("before"), 
uemail("before"), "pw"))
+    setInviteOnly(on = false)
+    resource.register(UserRegistrationRequest(uname("after"), uemail("after"), 
"pw"))
+
+    userDao.fetchByName(uname("before")).get(0).getRole shouldBe 
UserRoleEnum.INACTIVE
+    userDao.fetchByName(uname("after")).get(0).getRole shouldBe 
UserRoleEnum.REGULAR
+  }
+
   it should "reject an empty username" in {
     val ex = intercept[NotAcceptableException](
       resource.register(UserRegistrationRequest("   ", uemail("eu"), "pw"))
@@ -388,6 +434,7 @@ class AuthResourceSpec
     )
 
   it should "claim a placeholder account with the matching email" in {
+    setInviteOnly(on = true)
     val placeholder = seedPlaceholder(uname("ghost"), uemail("claim"))
 
     val response =
@@ -403,6 +450,18 @@ class AuthResourceSpec
     claimed.getComment should include("Claimed contributor placeholder at ")
   }
 
+  // Claiming a placeholder is how its owner signs up, so the account starts 
where a new one would.
+  it should "admit a claimed placeholder as REGULAR while invite-only is off" 
in {
+    setInviteOnly(on = false)
+    val placeholder = seedPlaceholder(uname("ghostopen"), uemail("claimopen"))
+
+    val response =
+      resource.register(UserRegistrationRequest(uname("claimeropen"), 
uemail("claimopen"), "pw"))
+
+    userDao.fetchOneByUid(placeholder.getUid).getRole shouldBe 
UserRoleEnum.REGULAR
+    roleClaimOf(response.accessToken) shouldBe "REGULAR"
+  }
+
   it should "allow logging in with the claimed credentials" in {
     seedPlaceholder(uname("ghost2"), uemail("claimlogin"))
     resource.register(UserRegistrationRequest(uname("claimer2"), 
uemail("claimlogin"), "secret-pw"))
@@ -652,6 +711,39 @@ class AuthResourceSpec
     emailClaimOf(response.accessToken) shouldBe uemail("fill")
   }
 
+  // A provider that asserts no address (ORCID) gets an INACTIVE account 
whatever the switch says,
+  // because the account is inert until it has an address. Supplying one is 
where that sign-up
+  // finishes, so that is where open sign-up admits it.
+  it should "admit an INACTIVE account as REGULAR once it supplies an address 
while invite-only is off" in {
+    setInviteOnly(on = false)
+    val user = seedEmaillessUser("admit")
+
+    val response = resource.setEmail(SetEmailRequest(uemail("admit")), new 
SessionUser(user))
+
+    userDao.fetchOneByUid(user.getUid).getRole shouldBe UserRoleEnum.REGULAR
+    roleClaimOf(response.accessToken) shouldBe "REGULAR"
+  }
+
+  it should "leave the account INACTIVE, awaiting approval, while invite-only 
is on" in {
+    setInviteOnly(on = true)
+    val user = seedEmaillessUser("await")
+
+    val response = resource.setEmail(SetEmailRequest(uemail("await")), new 
SessionUser(user))
+
+    userDao.fetchOneByUid(user.getUid).getRole shouldBe UserRoleEnum.INACTIVE
+    roleClaimOf(response.accessToken) shouldBe "INACTIVE"
+  }
+
+  // RESTRICTED is an admin's decision about this person, not a sign-up still 
in progress.
+  it should "keep a role an admin set when the account supplies its address" 
in {
+    setInviteOnly(on = false)
+    val user = seedEmaillessUser("restricted", role = UserRoleEnum.RESTRICTED)
+
+    resource.setEmail(SetEmailRequest(uemail("restricted")), new 
SessionUser(user))
+
+    userDao.fetchOneByUid(user.getUid).getRole shouldBe UserRoleEnum.RESTRICTED
+  }
+
   it should "reject a malformed address" in {
     val user = seedEmaillessUser("bad")
 
@@ -756,6 +848,30 @@ class AuthResourceSpec
     emailClaimOf(response.accessToken) shouldBe uemail("ghost")
   }
 
+  it should "admit the adopted placeholder as REGULAR while invite-only is 
off" in {
+    setInviteOnly(on = false)
+    val placeholder = seedPlaceholder(uname("ghostadmit"), 
uemail("ghostadmit"))
+    val caller = seedEmaillessUser("adopter")
+
+    val response =
+      resource.setEmail(SetEmailRequest(uemail("ghostadmit")), new 
SessionUser(caller))
+
+    userDao.fetchOneByUid(placeholder.getUid).getRole shouldBe 
UserRoleEnum.REGULAR
+    roleClaimOf(response.accessToken) shouldBe "REGULAR"
+  }
+
+  it should "keep the adopted placeholder INACTIVE while invite-only is on" in 
{
+    setInviteOnly(on = true)
+    val placeholder = seedPlaceholder(uname("ghostwait"), uemail("ghostwait"))
+    val caller = seedEmaillessUser("waiter")
+
+    val response =
+      resource.setEmail(SetEmailRequest(uemail("ghostwait")), new 
SessionUser(caller))
+
+    userDao.fetchOneByUid(placeholder.getUid).getRole shouldBe 
UserRoleEnum.INACTIVE
+    roleClaimOf(response.accessToken) shouldBe "INACTIVE"
+  }
+
   // `user_last_active_time.uid` references "user"(uid) with no ON DELETE 
CASCADE — the only FK to
   // "user" that does not cascade — so discarding the caller's row fails 
unless that row goes first.
   // Any authenticated request can have created it, so the adoption must not 
depend on its absence.
@@ -846,6 +962,7 @@ class AuthResourceSpec
   }
 
   "register/verify" should "create the account when the mailed code comes 
back" in {
+    setInviteOnly(on = true)
     verifying.register(UserRegistrationRequest(uname("done"), uemail("done"), 
"secret"))
 
     val response = verifying.registerVerify(
diff --git 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisionerSpec.scala
 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisionerSpec.scala
index 2f35df53f3..7ac0799fc4 100644
--- 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisionerSpec.scala
+++ 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/ExternalAuthProvisionerSpec.scala
@@ -19,8 +19,9 @@
 
 package org.apache.texera.web.resource.auth
 
-import org.apache.texera.dao.MockTexeraDB
-import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, USER}
+import org.apache.texera.auth.InviteOnly
+import org.apache.texera.dao.{MockTexeraDB, SiteSettings}
+import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, 
SITE_SETTINGS, USER}
 import org.apache.texera.dao.jooq.generated.enums.{ProviderTypeEnum, 
UserRoleEnum}
 import org.apache.texera.dao.jooq.generated.tables.daos.{AuthProviderDao, 
UserDao}
 import org.apache.texera.dao.jooq.generated.tables.pojos.{AuthProvider, User}
@@ -76,10 +77,27 @@ class ExternalAuthProvisionerSpec
         )
       )
       .execute()
+    getDSLContext
+      .deleteFrom(SITE_SETTINGS)
+      .where(SITE_SETTINGS.KEY.eq(InviteOnly.SettingKey))
+      .execute()
   }
 
   // ---- helpers -------------------------------------------------------------
 
+  /** Flip the invite-only switch the way the admin settings page does; 
`cleanup` removes it. */
+  private def setInviteOnly(on: Boolean): Unit =
+    SiteSettings.upsert(getDSLContext, InviteOnly.SettingKey, on.toString, 
"provisioner-admin")
+
+  /** A contributor placeholder as DatasetResource creates one: INACTIVE, with 
no credential. */
+  private def seedPlaceholder(name: String, localPart: String): User = {
+    val placeholder = seedUser(name, localPart)
+    placeholder.setIsPlaceholder(true)
+    placeholder.setRole(UserRoleEnum.INACTIVE)
+    userDao.update(placeholder)
+    placeholder
+  }
+
   /** Avatars are complete provider URLs now, so tests that assert on one have 
to use a URL. */
   private def avatarUrl(id: String): String = 
s"https://lh3.googleusercontent.com/a/$id";
 
@@ -136,7 +154,9 @@ class ExternalAuthProvisionerSpec
 
   // ---- new-identity provisioning -------------------------------------------
 
-  "ExternalAuthProvisioner.loginOrProvision" should "create an INACTIVE user 
and provider row for a brand-new Google identity" in {
+  "ExternalAuthProvisioner.loginOrProvision" should "create an INACTIVE user 
and provider row for a brand-new Google identity while invite-only is on" in {
+    setInviteOnly(on = true)
+
     val user = ExternalAuthProvisioner.loginOrProvision(
       profile("google-sub-1", "New User", "new" + emailDomain, avatar = 
Some(avatarUrl("a1")))
     )
@@ -151,6 +171,51 @@ class ExternalAuthProvisionerSpec
     providerIdOf(user.getUid, ProviderTypeEnum.GOOGLE) shouldBe "google-sub-1"
   }
 
+  it should "create a REGULAR user for a brand-new Google identity while 
invite-only is off" in {
+    setInviteOnly(on = false)
+
+    val user = ExternalAuthProvisioner.loginOrProvision(
+      profile("google-sub-open", "Open User", "open" + emailDomain)
+    )
+
+    user.getRole shouldBe UserRoleEnum.REGULAR
+    userDao.fetchOneByUid(user.getUid).getRole shouldBe UserRoleEnum.REGULAR
+  }
+
+  // Claiming a placeholder is how its owner signs up, so it starts where a 
new account would.
+  it should "admit a claimed INACTIVE placeholder as REGULAR while invite-only 
is off" in {
+    setInviteOnly(on = false)
+    val placeholder = seedPlaceholder("Ghost", "admitme")
+
+    ExternalAuthProvisioner.loginOrProvision(profile("sub-admit", "Ghost", 
"admitme" + emailDomain))
+
+    userDao.fetchOneByUid(placeholder.getUid).getRole shouldBe 
UserRoleEnum.REGULAR
+  }
+
+  it should "keep a claimed placeholder INACTIVE while invite-only is on" in {
+    setInviteOnly(on = true)
+    val placeholder = seedPlaceholder("Ghost", "waitme")
+
+    ExternalAuthProvisioner.loginOrProvision(profile("sub-wait", "Ghost", 
"waitme" + emailDomain))
+
+    userDao.fetchOneByUid(placeholder.getUid).getRole shouldBe 
UserRoleEnum.INACTIVE
+  }
+
+  // An INACTIVE account that is not a placeholder is a sign-up already 
waiting for approval. Adding
+  // a sign-in method to it is not a new sign-up, so turning invite-only off 
does not approve it.
+  it should "leave an existing INACTIVE account INACTIVE when a provider links 
to it" in {
+    setInviteOnly(on = false)
+    val pending = seedUser("Pending", "pending")
+    pending.setRole(UserRoleEnum.INACTIVE)
+    userDao.update(pending)
+
+    ExternalAuthProvisioner.loginOrProvision(
+      profile("sub-pending", "Pending", "pending" + emailDomain)
+    )
+
+    userDao.fetchOneByUid(pending.getUid).getRole shouldBe 
UserRoleEnum.INACTIVE
+  }
+
   // ---- returning known identity --------------------------------------------
 
   it should "be idempotent for a returning identity (same uid, no duplicate 
provider row or user)" in {
@@ -292,6 +357,19 @@ class ExternalAuthProvisionerSpec
     providerIdOf(user.getUid, ProviderTypeEnum.ORCID) shouldBe 
"0000-0001-0000-0001"
   }
 
+  // Such an account is inert until it has an address, and an INACTIVE caller 
is what lets
+  // AuthResource.setEmail hand it a contributor placeholder. The address step 
admits it instead.
+  it should "keep an identity-only account INACTIVE even while invite-only is 
off" in {
+    setInviteOnly(on = false)
+
+    val user =
+      ExternalAuthProvisioner.loginOrProvisionIdentityOnly(
+        orcidIdentity("0000-0001-0000-0009", "Open Researcher")
+      )
+
+    user.getRole shouldBe UserRoleEnum.INACTIVE
+  }
+
   // Two emailless accounts have to be able to coexist: `"user".email` is 
UNIQUE, which in Postgres
   // does not constrain repeated NULLs. If that ever changed, the second login 
would 500 here
   // rather than silently merging, but this pins the behavior either way.
diff --git 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/GoogleAuthResourceSpec.scala
 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/GoogleAuthResourceSpec.scala
index 78eb974eba..b5fbbccc92 100644
--- 
a/amber/src/test/scala/org/apache/texera/web/resource/auth/GoogleAuthResourceSpec.scala
+++ 
b/amber/src/test/scala/org/apache/texera/web/resource/auth/GoogleAuthResourceSpec.scala
@@ -20,9 +20,10 @@
 package org.apache.texera.web.resource.auth
 
 import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken
+import org.apache.texera.auth.InviteOnly
 import org.apache.texera.common.config.UserSystemConfig
-import org.apache.texera.dao.MockTexeraDB
-import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, USER}
+import org.apache.texera.dao.{MockTexeraDB, SiteSettings}
+import org.apache.texera.dao.jooq.generated.Tables.{AUTH_PROVIDER, 
SITE_SETTINGS, USER}
 import org.apache.texera.dao.jooq.generated.enums.{ProviderTypeEnum, 
UserRoleEnum}
 import org.apache.texera.dao.jooq.generated.tables.daos.UserDao
 import org.apache.texera.dao.jooq.generated.tables.pojos.User
@@ -63,8 +64,13 @@ class GoogleAuthResourceSpec
   override protected def beforeEach(): Unit = cleanup()
   override protected def afterEach(): Unit = cleanup()
 
-  private def cleanup(): Unit =
+  private def cleanup(): Unit = {
     getDSLContext.deleteFrom(USER).where(USER.EMAIL.like("%" + 
emailDomain)).execute()
+    getDSLContext
+      .deleteFrom(SITE_SETTINGS)
+      .where(SITE_SETTINGS.KEY.eq(InviteOnly.SettingKey))
+      .execute()
+  }
 
   // ---- helpers -------------------------------------------------------------
 
@@ -118,6 +124,10 @@ class GoogleAuthResourceSpec
   behavior of "login"
 
   it should "provision an INACTIVE user and a GOOGLE provider row on a first 
login" in {
+    // The role follows the admin's invite-only switch 
(ExternalAuthProvisionerSpec covers both
+    // sides); pinned on here so the assertion does not depend on default.conf.
+    SiteSettings.upsert(getDSLContext, InviteOnly.SettingKey, "true", 
"google-spec-admin")
+
     loginWith(payload("google-sub-new", "newcomer" + emailDomain, name = "New 
Comer"))
 
     val user = userByEmail("newcomer")
diff --git a/bin/k8s/values-development.yaml b/bin/k8s/values-development.yaml
index 7ed9c532d1..362c62010a 100644
--- a/bin/k8s/values-development.yaml
+++ b/bin/k8s/values-development.yaml
@@ -398,6 +398,8 @@ texeraEnvVars:
     value: "true"
   - name: COMPUTING_UNIT_SHARING_ENABLED
     value: "true"
+  # Only the starting value of Admin > Settings > Invite Only, stored when 
config-service first
+  # starts; after that the settings page owns it, and its Reset restores this 
value.
   - name: USER_SYS_INVITE_ONLY
     value: "true"
   # On by default; set to "false" to accept addresses unproven. This must 
agree with the
diff --git a/bin/k8s/values.yaml b/bin/k8s/values.yaml
index 661da84e43..ba74316b12 100644
--- a/bin/k8s/values.yaml
+++ b/bin/k8s/values.yaml
@@ -503,6 +503,8 @@ texeraEnvVars:
     value: "true"
   - name: COMPUTING_UNIT_SHARING_ENABLED
     value: "true"
+  # Only the starting value of Admin > Settings > Invite Only, stored when 
config-service first
+  # starts; after that the settings page owns it, and its Reset restores this 
value.
   - name: USER_SYS_INVITE_ONLY
     value: "true"
   # On by default; set to "false" to accept addresses unproven. This must 
agree with the
diff --git a/common/auth/src/main/scala/org/apache/texera/auth/InviteOnly.scala 
b/common/auth/src/main/scala/org/apache/texera/auth/InviteOnly.scala
new file mode 100644
index 0000000000..2420d1bfd7
--- /dev/null
+++ b/common/auth/src/main/scala/org/apache/texera/auth/InviteOnly.scala
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.auth
+
+import com.typesafe.scalalogging.LazyLogging
+import org.apache.texera.common.config.DefaultsConfig
+import org.apache.texera.dao.SiteSettings
+
+import scala.util.{Failure, Success, Try}
+
+/**
+  * Whether a new account has to wait for an admin's approval before it can be 
used.
+  *
+  * The switch is the `invite_only` site setting, which admins flip on the 
Admin Settings page. It
+  * is read on every call, so a change reaches the next sign-up without a 
restart. default.conf's
+  * `user-sys.invite_only` (USER_SYS_INVITE_ONLY) seeds that row and stands in 
while no row exists.
+  */
+object InviteOnly extends LazyLogging {
+
+  /** The `site_settings` key, which is also the default.conf leaf that seeds 
it. */
+  val SettingKey = "invite_only"
+
+  def enabled: Boolean = decide(SiteSettings.lookup(SettingKey), 
DefaultsConfig.inviteOnly)
+
+  /**
+    * The configured value applies only while no row is stored. A read that 
fails, or a value that
+    * is neither true nor false, keeps sign-up closed: a REGULAR account can 
run code on the server,
+    * so sign-up is open only when the row says so.
+    */
+  private[auth] def decide(stored: Try[Option[String]], configured: => 
Boolean): Boolean =
+    stored match {
+      case Success(None) => configured
+      case Success(Some(value)) =>
+        value.trim.toBooleanOption.getOrElse {
+          logger.warn(s"The $SettingKey setting holds '$value', not true or 
false; keeping it on.")
+          true
+        }
+      case Failure(e) =>
+        logger.warn(s"Could not read the $SettingKey setting; keeping it on.", 
e)
+        true
+    }
+}
diff --git 
a/common/auth/src/test/scala/org/apache/texera/auth/InviteOnlySpec.scala 
b/common/auth/src/test/scala/org/apache/texera/auth/InviteOnlySpec.scala
new file mode 100644
index 0000000000..a992c6918c
--- /dev/null
+++ b/common/auth/src/test/scala/org/apache/texera/auth/InviteOnlySpec.scala
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.auth
+
+import org.apache.texera.common.config.DefaultsConfig
+import org.apache.texera.dao.{MockTexeraDB, SiteSettings}
+import org.apache.texera.dao.jooq.generated.Tables.SITE_SETTINGS
+import org.scalatest.flatspec.AnyFlatSpec
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
+
+import scala.util.{Failure, Success}
+
+/**
+  * Spec for [[InviteOnly]]: the switch is the `invite_only` site setting the 
admin settings page
+  * writes, read again on every call. default.conf's value stands in only 
while no row is stored;
+  * a row that cannot be read or parsed keeps sign-up closed.
+  */
+class InviteOnlySpec
+    extends AnyFlatSpec
+    with Matchers
+    with BeforeAndAfterAll
+    with BeforeAndAfterEach
+    with MockTexeraDB {
+
+  override protected def beforeAll(): Unit = initializeDBAndReplaceDSLContext()
+
+  override protected def afterAll(): Unit = closeConnectionPool()
+
+  override protected def beforeEach(): Unit =
+    getDSLContext
+      .deleteFrom(SITE_SETTINGS)
+      .where(SITE_SETTINGS.KEY.eq(InviteOnly.SettingKey))
+      .execute()
+
+  private def store(value: String): Unit =
+    SiteSettings.upsert(getDSLContext, InviteOnly.SettingKey, value, 
"spec-admin")
+
+  private def configuredDefault: Boolean = DefaultsConfig.inviteOnly
+
+  // The settings API only writes keys that have a default.conf entry, so a 
key without one could
+  // never be switched from the admin page.
+  "InviteOnly.SettingKey" should "name a default.conf entry, so the settings 
API accepts it" in {
+    DefaultsConfig.allDefaults should contain key InviteOnly.SettingKey
+  }
+
+  "InviteOnly.enabled" should "follow the stored setting, including a change 
made after startup" in {
+    store("true")
+    InviteOnly.enabled shouldBe true
+
+    store("false")
+    InviteOnly.enabled shouldBe false
+  }
+
+  it should "use the default.conf value while no row is stored" in {
+    InviteOnly.enabled shouldBe configuredDefault
+  }
+
+  it should "keep sign-up closed when the stored row is not a boolean" in {
+    store("sometimes")
+    InviteOnly.enabled shouldBe true
+  }
+
+  it should "keep sign-up closed when the setting cannot be read" in {
+    store("false")
+    getDSLContext.execute("ALTER TABLE texera_db.site_settings RENAME TO 
site_settings_away")
+    try InviteOnly.enabled shouldBe true
+    finally getDSLContext.execute(
+      "ALTER TABLE texera_db.site_settings_away RENAME TO site_settings"
+    )
+  }
+
+  // The decision on its own, so the configured value can be `false`: with the 
shipped default
+  // (`true`) falling back to it and failing closed look the same.
+  "InviteOnly.decide" should "take a stored true or false, in any case and 
padding" in {
+    InviteOnly.decide(Success(Some("true")), configured = false) shouldBe true
+    InviteOnly.decide(Success(Some(" FALSE ")), configured = true) shouldBe 
false
+  }
+
+  it should "use the configured value only while no row is stored" in {
+    InviteOnly.decide(Success(None), configured = false) shouldBe false
+    InviteOnly.decide(Success(None), configured = true) shouldBe true
+  }
+
+  // A REGULAR account can run code on the server, so only a row that says 
false opens sign-up.
+  it should "fail closed when the read fails, whatever the configured value" 
in {
+    InviteOnly.decide(
+      Failure(new RuntimeException("pool timeout")),
+      configured = false
+    ) shouldBe true
+  }
+
+  it should "fail closed when the stored value is not a boolean, whatever the 
configured value" in {
+    Seq("sometimes", "off", "").foreach { raw =>
+      InviteOnly.decide(Success(Some(raw)), configured = false) shouldBe true
+    }
+  }
+}
diff --git a/common/config/src/main/resources/default.conf 
b/common/config/src/main/resources/default.conf
index e815a27f9e..6442ba07e4 100644
--- a/common/config/src/main/resources/default.conf
+++ b/common/config/src/main/resources/default.conf
@@ -117,6 +117,20 @@ model {
   model_multipart_upload_chunk_size_mib = 
${?MODEL_MULTIPART_UPLOAD_CHUNK_SIZE_MIB}
 }
 
+# Sign-up policy. Management-only like `operator` below: the login page reads 
the
+# switch through /config/pre-login, so it stays out of the anonymous
+# /config/settings/public whitelist.
+user-sys {
+  # true: a new account is INACTIVE until an admin approves it on the Users 
page.
+  # false: a new account is REGULAR and usable as soon as it signs up.
+  # On by default: a REGULAR account can run code on the server, so open 
sign-up
+  # is a deployment's own choice.
+  # USER_SYS_INVITE_ONLY only seeds the setting; once the row exists, the Admin
+  # Settings page owns it (Reset there restores this value).
+  invite_only = true
+  invite_only = ${?USER_SYS_INVITE_ONLY}
+}
+
 # Operator-level defaults. These are management-only site settings (edited from
 # the admin page, read by the engine) and are deliberately NOT under
 # gui/dataset/model, so they stay out of the anonymous /config/settings/public
diff --git a/common/config/src/main/resources/user-system.conf 
b/common/config/src/main/resources/user-system.conf
index 312aaa6313..657f88e4b3 100644
--- a/common/config/src/main/resources/user-system.conf
+++ b/common/config/src/main/resources/user-system.conf
@@ -71,8 +71,8 @@ user-sys {
   project-name = "Texera"
   project-name = ${?USER_SYS_PROJECT_NAME}
 
-  invite-only = false
-  invite-only = ${?USER_SYS_INVITE_ONLY}
+  # Invite-only lives in default.conf (user-sys.invite_only): admins switch it 
on the Admin
+  # Settings page, and USER_SYS_INVITE_ONLY seeds it.
 
   # Whether an address the user typed must be proved by a code mailed to it 
before it is accepted —
   # at registration, and when an account with no address on file supplies one. 
An address a provider
diff --git 
a/common/config/src/main/scala/org/apache/texera/common/config/DefaultsConfig.scala
 
b/common/config/src/main/scala/org/apache/texera/common/config/DefaultsConfig.scala
index 3a00e8da5d..2e5ea8d559 100644
--- 
a/common/config/src/main/scala/org/apache/texera/common/config/DefaultsConfig.scala
+++ 
b/common/config/src/main/scala/org/apache/texera/common/config/DefaultsConfig.scala
@@ -18,32 +18,72 @@
 
 package org.apache.texera.common.config
 
-import com.typesafe.config.{ConfigFactory, ConfigRenderOptions, 
ConfigValueType}
+import com.typesafe.config.{
+  Config,
+  ConfigFactory,
+  ConfigRenderOptions,
+  ConfigResolveOptions,
+  ConfigValueType
+}
 
 import scala.jdk.CollectionConverters.CollectionHasAsScala
 
 object DefaultsConfig {
-  private val conf = ConfigFactory.parseResources("default.conf").resolve()
+  private val declared = ConfigFactory.parseResources("default.conf")
+  private val conf = declared.resolve()
   val reinit: Boolean =
     
conf.getBoolean("config-service.always-reset-configurations-to-default-values")
 
+  // Typed rather than read off `allDefaults`: HOCON's parsing keeps the 
spellings
+  // USER_SYS_INVITE_ONLY has always accepted (yes/no, on/off), and an 
unreadable value stops
+  // config-service at startup, when it loads this object to seed 
site_settings. `seedValues`
+  // stores the parsed value too, because every reader of the row expects true 
or false.
+  private val InviteOnlyPath = "user-sys.invite_only"
+  val inviteOnly: Boolean = conf.getBoolean(InviteOnlyPath)
+
   // site_settings rows are keyed by the last path segment of a HOCON key, so
   // this is the single place that turns a config path into a row key.
   private def shortKey(fullKey: String): String = fullKey.split("\\.").last
 
-  val allDefaults: Map[String, String] = {
-    val entries = conf
+  // The leaves default.conf itself declares as booleans. Resolved without the 
environment, because
+  // a `${?ENV}` override always arrives as a string: GUI_TABS_HUB_ENABLED=on 
would otherwise make
+  // its leaf look like a string setting.
+  private val booleanPaths: Set[String] =
+    declared
+      .resolve(ConfigResolveOptions.noSystem())
+      .entrySet()
+      .asScala
+      .collect {
+        case entry if entry.getValue.valueType() == ConfigValueType.BOOLEAN => 
entry.getKey
+      }
+      .toSet
+
+  val allDefaults: Map[String, String] = seedValues(conf)
+
+  /**
+    * The site_settings rows that `source` seeds: every leaf under its short 
key, with each leaf that
+    * default.conf declares as a boolean stored as true or false, the only 
spellings its readers
+    * accept. A value HOCON cannot read as a boolean throws, which stops 
config-service at startup,
+    * as `reinit` and `inviteOnly` already do. A parameter rather than `conf`, 
so a test can feed in
+    * each spelling HOCON accepts without setting the environment.
+    */
+  private[config] def seedValues(source: Config): Map[String, String] = {
+    val entries = source
       .entrySet()
       .asScala
       .toSeq
       .map { entry =>
-        val value = entry.getValue.valueType() match {
-          case ConfigValueType.STRING | ConfigValueType.NUMBER | 
ConfigValueType.BOOLEAN =>
-            entry.getValue.unwrapped().toString
-          case _ =>
-            entry.getValue.render(ConfigRenderOptions.concise())
-        }
-        shortKey(entry.getKey) -> value
+        val path = entry.getKey
+        val value =
+          if (booleanPaths.contains(path)) source.getBoolean(path).toString
+          else
+            entry.getValue.valueType() match {
+              case ConfigValueType.STRING | ConfigValueType.NUMBER | 
ConfigValueType.BOOLEAN =>
+                entry.getValue.unwrapped().toString
+              case _ =>
+                entry.getValue.render(ConfigRenderOptions.concise())
+            }
+        shortKey(path) -> value
       }
 
     // Since the row key is only the last path segment, two entries under
diff --git 
a/common/config/src/main/scala/org/apache/texera/common/config/UserSystemConfig.scala
 
b/common/config/src/main/scala/org/apache/texera/common/config/UserSystemConfig.scala
index 18ee4dea67..f13471d27b 100644
--- 
a/common/config/src/main/scala/org/apache/texera/common/config/UserSystemConfig.scala
+++ 
b/common/config/src/main/scala/org/apache/texera/common/config/UserSystemConfig.scala
@@ -37,7 +37,6 @@ object UserSystemConfig {
   val appleClientId: String = conf.getString("user-sys.apple.clientId")
   val gmail: String = conf.getString("user-sys.google.smtp.gmail")
   val smtpPassword: String = conf.getString("user-sys.google.smtp.password")
-  val inviteOnly: Boolean = conf.getBoolean("user-sys.invite-only")
   val emailVerification: Boolean = 
conf.getBoolean("user-sys.email-verification")
   val projectName: String = conf.getString("user-sys.project-name")
   val workflowVersionCollapseIntervalInMinutes: Int =
diff --git 
a/common/config/src/test/scala/org/apache/texera/common/config/DefaultsConfigSpec.scala
 
b/common/config/src/test/scala/org/apache/texera/common/config/DefaultsConfigSpec.scala
index 52da44ca12..e96f20d127 100644
--- 
a/common/config/src/test/scala/org/apache/texera/common/config/DefaultsConfigSpec.scala
+++ 
b/common/config/src/test/scala/org/apache/texera/common/config/DefaultsConfigSpec.scala
@@ -19,6 +19,7 @@
 
 package org.apache.texera.common.config
 
+import com.typesafe.config.{ConfigException, ConfigFactory}
 import org.scalatest.flatspec.AnyFlatSpec
 import org.scalatest.matchers.should.Matchers
 
@@ -38,6 +39,55 @@ class DefaultsConfigSpec extends AnyFlatSpec with Matchers {
     )
   }
 
+  // A REGULAR account can run code on the server, so open sign-up has to be a 
deployment's own
+  // choice rather than what it gets by leaving USER_SYS_INVITE_ONLY unset.
+  "DefaultsConfig.inviteOnly" should "default to invite-only" in {
+    ifUnset("USER_SYS_INVITE_ONLY")(DefaultsConfig.inviteOnly shouldBe true)
+  }
+
+  // HOCON also accepts yes/no and on/off, but every reader of the stored row 
expects true or false:
+  // the backend reads anything else as on, and so does the admin card. The 
spellings are fed in
+  // directly because CI never sets USER_SYS_INVITE_ONLY.
+  "DefaultsConfig.seedValues" should "seed invite-only as true or false, 
whatever the spelling" in {
+    Seq("off" -> "false", "no" -> "false", "on" -> "true", "yes" -> 
"true").foreach {
+      case (spelling, seeded) =>
+        DefaultsConfig
+          .seedValues(ConfigFactory.parseString(s"user-sys.invite_only = 
$spelling"))
+          .get("invite_only") shouldBe Some(seeded)
+    }
+  }
+
+  // default.conf as config-service resolves it, with one leaf overridden the 
way a `${?ENV}`
+  // substitution overrides it: as a string, in whatever spelling the variable 
used.
+  private def seededWith(path: String, spelling: String): Map[String, String] =
+    DefaultsConfig.seedValues(
+      ConfigFactory
+        .parseString(s"$path = $spelling")
+        .withFallback(ConfigFactory.parseResources("default.conf"))
+        .resolve()
+    )
+
+  // The dashboard and the admin page show a sidebar tab only when its row is 
exactly "true", so
+  // GUI_TABS_HUB_ENABLED=on used to hide the Hub tab it meant to show.
+  it should "seed every sidebar tab switch and the reset flag as true or 
false, whatever the spelling" in {
+    val tabs = 
DefaultsConfig.keysUnderSections(Set("gui")).filter(_.endsWith("_enabled"))
+    tabs should not be empty
+    val resetFlag = 
"config-service.always-reset-configurations-to-default-values"
+    val paths = tabs.map("gui.tabs." + _) + resetFlag
+    for {
+      path <- paths
+      (spelling, seeded) <- Seq("off" -> "false", "no" -> "false", "on" -> 
"true", "yes" -> "true")
+    } withClue(s"$path = $spelling: ") {
+      seededWith(path, spelling).get(path.split('.').last) shouldBe 
Some(seeded)
+    }
+  }
+
+  // Like USER_SYS_INVITE_ONLY and the reset flag, which are read with 
getBoolean at startup: a
+  // value that is not a boolean stops config-service there, rather than 
hiding a tab later.
+  it should "refuse a value that is not a boolean, rather than seed it" in {
+    a[ConfigException.WrongType] should be thrownBy 
seededWith("gui.tabs.hub_enabled", "maybe")
+  }
+
   "DefaultsConfig.allDefaults" should "flatten default.conf into 
short-key/value entries" in {
     val defaults = DefaultsConfig.allDefaults
     defaults should not be empty
@@ -57,6 +107,8 @@ class DefaultsConfigSpec extends AnyFlatSpec with Matchers {
     ifUnset("OPERATOR_CSV_PARSER_MAX_COLUMNS")(
       defaults.get("csv_parser_max_columns") shouldBe Some("512")
     )
+    // the invite-only switch, seeded from the variable the user system has 
always read
+    ifUnset("USER_SYS_INVITE_ONLY")(defaults.get("invite_only") shouldBe 
Some("true"))
     // every value is rendered as a String
     defaults.values.foreach(_ shouldBe a[String])
   }
diff --git 
a/common/config/src/test/scala/org/apache/texera/common/config/UserSystemConfigSpec.scala
 
b/common/config/src/test/scala/org/apache/texera/common/config/UserSystemConfigSpec.scala
index 0e42bf3f5c..2265d9fe52 100644
--- 
a/common/config/src/test/scala/org/apache/texera/common/config/UserSystemConfigSpec.scala
+++ 
b/common/config/src/test/scala/org/apache/texera/common/config/UserSystemConfigSpec.scala
@@ -70,7 +70,6 @@ class UserSystemConfigSpec extends AnyFlatSpec with Matchers {
       UserSystemConfig.orcidRedirectUri shouldBe 
"http://127.0.0.1:4200/callback/orcid";
     )
     ifUnset("USER_SYS_PROJECT_NAME")(UserSystemConfig.projectName shouldBe 
"Texera")
-    ifUnset("USER_SYS_INVITE_ONLY")(UserSystemConfig.inviteOnly shouldBe false)
     ifUnset("USER_SYS_EMAIL_VERIFICATION")(UserSystemConfig.emailVerification 
shouldBe false)
     ifUnset("USER_SYS_VERSION_TIME_LIMIT_IN_MINUTES")(
       UserSystemConfig.workflowVersionCollapseIntervalInMinutes shouldBe 60
diff --git a/common/dao/src/main/scala/org/apache/texera/dao/SiteSettings.scala 
b/common/dao/src/main/scala/org/apache/texera/dao/SiteSettings.scala
index d818f0f056..45326aa326 100644
--- a/common/dao/src/main/scala/org/apache/texera/dao/SiteSettings.scala
+++ b/common/dao/src/main/scala/org/apache/texera/dao/SiteSettings.scala
@@ -32,11 +32,12 @@ import scala.util.Try
   * config-service startup seeder, so the column set / audit stamping live in
   * one place.
   *
-  * Failures swallowed by the outer Try on the read path include: SqlServer not
-  * initialised (e.g. on workers in distributed mode), no row for the key, and
-  * value that can't be parsed. In all of these cases the caller's default 
takes
-  * over. The write helpers take an explicit [[DSLContext]] so callers can run
-  * them inside their own transaction and surface failures.
+  * The typed getters fall back to the caller's default when the read fails 
(e.g.
+  * SqlServer not initialised on workers in distributed mode), when the key has
+  * no row, and when the value can't be parsed. [[lookup]] instead returns a
+  * failed read as a `Failure` and a missing row as `None`, for a caller that
+  * must tell them apart. The write helpers take an explicit [[DSLContext]] so
+  * callers can run them inside their own transaction and surface failures.
   */
 object SiteSettings {
 
@@ -46,6 +47,24 @@ object SiteSettings {
   def getLong(key: String, default: => Long): Long =
     readAndParse(key, default)(_.toLong)
 
+  /**
+    * The stored value of `key`, unparsed: `Success(None)` when there is no 
row, and a `Failure`
+    * when the read itself fails. For a caller that must tell those apart, 
which the getters above
+    * fold into their default.
+    */
+  def lookup(key: String): Try[Option[String]] =
+    Try(
+      Option(
+        SqlServer
+          .getInstance()
+          .createDSLContext()
+          .select(SITE_SETTINGS.VALUE)
+          .from(SITE_SETTINGS)
+          .where(SITE_SETTINGS.KEY.eq(key))
+          .fetchOneInto(classOf[String])
+      )
+    )
+
   /** Insert or overwrite the row for `key`, stamping who/when. */
   def upsert(ctx: DSLContext, key: String, value: String, updatedBy: String): 
Unit =
     ctx
@@ -77,14 +96,5 @@ object SiteSettings {
     raw.flatMap(s => Try(parse(s.trim)).toOption).getOrElse(default)
 
   private def readAndParse[T](key: String, default: => T)(parse: String => T): 
T =
-    Try {
-      val raw = SqlServer
-        .getInstance()
-        .createDSLContext()
-        .select(SITE_SETTINGS.VALUE)
-        .from(SITE_SETTINGS)
-        .where(SITE_SETTINGS.KEY.eq(key))
-        .fetchOneInto(classOf[String])
-      parseOrDefault(Option(raw), default)(parse)
-    }.getOrElse(default)
+    parseOrDefault(lookup(key).toOption.flatten, default)(parse)
 }
diff --git 
a/common/dao/src/test/scala/org/apache/texera/dao/SiteSettingsSpec.scala 
b/common/dao/src/test/scala/org/apache/texera/dao/SiteSettingsSpec.scala
index 33199aae26..5a73acf3d3 100644
--- a/common/dao/src/test/scala/org/apache/texera/dao/SiteSettingsSpec.scala
+++ b/common/dao/src/test/scala/org/apache/texera/dao/SiteSettingsSpec.scala
@@ -24,6 +24,8 @@ import org.scalatest.BeforeAndAfterEach
 import org.scalatest.flatspec.AnyFlatSpec
 import org.scalatest.matchers.should.Matchers
 
+import scala.util.Success
+
 class SiteSettingsSpec
     extends AnyFlatSpec
     with Matchers
@@ -88,11 +90,41 @@ class SiteSettingsSpec
     SiteSettings.getInt("bad_int", 7) shouldBe 7
   }
 
+  // Unlike `lookup`, the getters fold a failed read into the default, as the 
object doc says.
+  it should "return the default when the read itself fails" in {
+    SiteSettings.upsert(getDSLContext, "max_x", "42", "admin")
+    getDSLContext.execute("ALTER TABLE texera_db.site_settings RENAME TO 
site_settings_away")
+    try SiteSettings.getInt("max_x", 7) shouldBe 7
+    finally getDSLContext.execute(
+      "ALTER TABLE texera_db.site_settings_away RENAME TO site_settings"
+    )
+  }
+
   "getLong" should "return the stored long value when the key is present" in {
     SiteSettings.upsert(getDSLContext, "big", "9999999999", "admin")
     SiteSettings.getLong("big", 0L) shouldBe 9999999999L
   }
 
+  "lookup" should "return the stored value, as written, for a key that has a 
row" in {
+    SiteSettings.upsert(getDSLContext, "flag", " TRUE ", "admin")
+    SiteSettings.lookup("flag") shouldBe Success(Some(" TRUE "))
+  }
+
+  it should "return no value, rather than a failure, for a key without a row" 
in {
+    SiteSettings.lookup("missing_flag") shouldBe Success(None)
+  }
+
+  // A caller deciding something security-relevant has to tell "never written" 
from "could not be
+  // read": only the first may fall back to a configured default.
+  it should "return a failure when the read itself fails" in {
+    SiteSettings.upsert(getDSLContext, "flag", "true", "admin")
+    getDSLContext.execute("ALTER TABLE texera_db.site_settings RENAME TO 
site_settings_away")
+    try SiteSettings.lookup("flag").isFailure shouldBe true
+    finally getDSLContext.execute(
+      "ALTER TABLE texera_db.site_settings_away RENAME TO site_settings"
+    )
+  }
+
   "upsert" should "insert a new row and then overwrite it with the latest 
value and writer" in {
     SiteSettings.upsert(getDSLContext, "k", "1", "admin")
     SiteSettings.getInt("k", 0) shouldBe 1
diff --git 
a/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
 
b/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
index ab8eaa9030..4ec39b74fe 100644
--- 
a/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
+++ 
b/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
@@ -24,7 +24,7 @@ import io.dropwizard.auth.Auth
 import jakarta.annotation.security.{PermitAll, RolesAllowed}
 import jakarta.ws.rs.core.{MediaType, Response}
 import jakarta.ws.rs.{Consumes, GET, POST, PUT, Path, PathParam, Produces}
-import org.apache.texera.auth.SessionUser
+import org.apache.texera.auth.{InviteOnly, SessionUser}
 import org.apache.texera.common.config.{
   ApplicationConfig,
   ComputingUnitConfig,
@@ -56,7 +56,7 @@ class ConfigResource {
   // Anonymous endpoint loaded by the frontend's APP_INITIALIZER before any 
user has
   // logged in. Only fields that the login page (or the logged-out branches of 
the
   // dashboard shell) actually need belong here — anything else lives on /gui 
or
-  // /user-system, both of which require authentication.
+  // /amber, both of which require authentication.
   @GET
   @PermitAll
   @Path("/pre-login")
@@ -72,7 +72,9 @@ class ConfigResource {
       ),
       "attributionEnabled" -> GuiConfig.guiAttributionEnabled,
       "deploymentVersionCheckEnabled" -> 
GuiConfig.guiDeploymentVersionCheckEnabled,
-      "inviteOnly" -> UserSystemConfig.inviteOnly,
+      // Read per request: admins switch it on the settings page, and the 
sign-up form uses it to
+      // say whether a new account has to wait for an admin.
+      "inviteOnly" -> InviteOnly.enabled,
       // The sign-up form decides whether to expect a code step before anyone 
has a token, so this
       // has to be readable anonymously.
       "emailVerification" -> UserSystemConfig.emailVerification
@@ -117,15 +119,6 @@ class ConfigResource {
       "defaultDataTransferBatchSize" -> 
ApplicationConfig.defaultDataTransferBatchSize
     )
 
-  @GET
-  @RolesAllowed(Array("REGULAR", "ADMIN"))
-  @Path("/user-system")
-  def getUserSystemConfig: Map[String, Any] =
-    Map(
-      // flags from the user-system.conf
-      "inviteOnly" -> UserSystemConfig.inviteOnly
-    )
-
   // The site_settings keys that non-admin pages consume: dashboard branding,
   // sidebar tab toggles, and the dataset/model upload limits — exactly the
   // gui.*, dataset.* and model.* sections of default.conf, which is also where
diff --git 
a/config-service/src/test/scala/org/apache/texera/service/resource/ConfigResourceSpec.scala
 
b/config-service/src/test/scala/org/apache/texera/service/resource/ConfigResourceSpec.scala
index ce3819d8be..771b817936 100644
--- 
a/config-service/src/test/scala/org/apache/texera/service/resource/ConfigResourceSpec.scala
+++ 
b/config-service/src/test/scala/org/apache/texera/service/resource/ConfigResourceSpec.scala
@@ -178,22 +178,6 @@ class ConfigResourceSpec
     )
   }
 
-  "GET /config/user-system" should "return 401 with a Bearer challenge without 
an Authorization header" in {
-    val response =
-      
resources.target("/config/user-system").request(MediaType.APPLICATION_JSON).get()
-    response.getStatus shouldBe 401
-    response.getHeaderString("WWW-Authenticate") shouldBe 
JwtAuthFilter.BearerChallenge
-  }
-
-  it should "return 200 with a valid Bearer token whose role matches 
@RolesAllowed" in {
-    val response = resources
-      .target("/config/user-system")
-      .request(MediaType.APPLICATION_JSON)
-      .header("Authorization", s"Bearer ${regularToken()}")
-      .get()
-    response.getStatus shouldBe 200
-  }
-
   "GET /config/amber" should "return 401 with a Bearer challenge without an 
Authorization header" in {
     val response =
       
resources.target("/config/amber").request(MediaType.APPLICATION_JSON).get()
@@ -475,6 +459,38 @@ class ConfigResourceSpec
     resource.getSetting("csv_parser_max_columns").settingValue shouldBe
       DefaultsConfig.allDefaults("csv_parser_max_columns")
   }
+
+  it should "restore the invite-only switch to its default.conf value" in {
+    // Write the opposite of the default, so the reset shows whichever way the 
default is set.
+    val opposite = (!DefaultsConfig.inviteOnly).toString
+    resource.updateSetting(
+      adminSession(),
+      "invite_only",
+      ConfigSettingPojo("invite_only", opposite)
+    )
+    resource.getSetting("invite_only").settingValue shouldBe opposite
+
+    resource.resetSetting(adminSession(), "invite_only").getStatus shouldBe 200
+    resource.getSetting("invite_only").settingValue shouldBe
+      DefaultsConfig.allDefaults("invite_only")
+  }
+
+  // The sign-up form reads this payload to say whether a new account has to 
wait for an admin, and
+  // the switch is now edited on the admin settings page. A value frozen at 
service start would keep
+  // the form out of step with the role the next sign-up gets.
+  "getPreLoginConfig" should "report invite-only as the admin settings page 
last wrote it" in {
+    resource.updateSetting(adminSession(), "invite_only", 
ConfigSettingPojo("invite_only", "true"))
+    resource.getPreLoginConfig("inviteOnly") shouldBe true
+
+    resource.updateSetting(adminSession(), "invite_only", 
ConfigSettingPojo("invite_only", "false"))
+    resource.getPreLoginConfig("inviteOnly") shouldBe false
+  }
+
+  it should "fall back to the default.conf value while no invite_only row is 
stored" in {
+    
getDSLContext.deleteFrom(SITE_SETTINGS).where(SITE_SETTINGS.KEY.eq("invite_only")).execute()
+
+    resource.getPreLoginConfig("inviteOnly") shouldBe DefaultsConfig.inviteOnly
+  }
 }
 
 object ConfigResourceSpec {
diff --git a/docs/contribution-guidelines/guide-for-developers.md 
b/docs/contribution-guidelines/guide-for-developers.md
index 5a58c22a95..d595776baf 100644
--- a/docs/contribution-guidelines/guide-for-developers.md
+++ b/docs/contribution-guidelines/guide-for-developers.md
@@ -307,8 +307,10 @@ Note: Jooq creates DAO for simple operations if the 
requested SQL query is compl
 ### Disable password login
 Edit `common/config/src/main/resources/gui.conf`, change `local-login` to 
`false`.
 
-### Enforce invite only
-Edit `common/config/src/main/resources/user-system.conf`, change `invite-only` 
to `true`.
+### Invite-only sign-up
+Invite-only is on by default: a new account stays inactive until an admin 
approves it on the **Users** page. To let new accounts in at once, sign in as 
an admin, open **Admin → Settings**, turn off **Invite Only** under 
**Registration**, and click **Save**. Accounts that sign up while it is off can 
run their own code in workflows.
+
+`USER_SYS_INVITE_ONLY` (or `invite_only` in 
`common/config/src/main/resources/default.conf`) only sets the starting value, 
which config-service stores the first time it starts. After that the settings 
page owns it, and its **Reset** button restores the configured value.
 
 ### Backend endpoints Role Annotation
 There are two types of permissions for the backend endpoints:
diff --git a/frontend/src/app/common/service/gui-config.service.spec.ts 
b/frontend/src/app/common/service/gui-config.service.spec.ts
index 9af662318c..c8c6d215a7 100644
--- a/frontend/src/app/common/service/gui-config.service.spec.ts
+++ b/frontend/src/app/common/service/gui-config.service.spec.ts
@@ -32,6 +32,7 @@ const PRE_LOGIN_PAYLOAD = {
   googleLogin: false,
   defaultLocalUser: { username: "demo", password: "demo-pw" },
   attributionEnabled: true,
+  inviteOnly: true,
 };
 
 const GUI_PAYLOAD = {
@@ -44,10 +45,6 @@ const AMBER_PAYLOAD = {
   defaultDataTransferBatchSize: 400,
 };
 
-const USER_SYSTEM_PAYLOAD = {
-  inviteOnly: true,
-};
-
 describe("GuiConfigService", () => {
   let service: GuiConfigService;
   let http: HttpTestingController;
@@ -82,6 +79,7 @@ describe("GuiConfigService", () => {
     expect(service.env.googleLogin).toBe(false);
     expect(service.env.defaultLocalUser).toEqual({ username: "demo", password: 
"demo-pw" });
     expect(service.env.attributionEnabled).toBe(true);
+    expect(service.env.inviteOnly).toBe(true);
   });
 
   it("loadPreLogin propagates errors so APP_INITIALIZER can surface them", 
async () => {
@@ -95,29 +93,28 @@ describe("GuiConfigService", () => {
 
   // ─── loadPostLogin ────────────────────────────────────────────────────────
 
-  it("loadPostLogin fetches /config/gui, /config/amber and /config/user-system 
in parallel and merges", async () => {
+  it("loadPostLogin fetches /config/gui and /config/amber in parallel and 
merges", async () => {
     const pending = firstValueFrom(service.loadPostLogin());
 
     const gui = http.expectOne(`${API}/config/gui`);
     const amber = http.expectOne(`${API}/config/amber`);
-    const userSystem = http.expectOne(`${API}/config/user-system`);
     expect(gui.request.method).toBe("GET");
     expect(amber.request.method).toBe("GET");
-    expect(userSystem.request.method).toBe("GET");
+    // Sign-in decides the pending screen from the role alone, and the sign-up 
form already has
+    // inviteOnly from /config/pre-login, so nothing after sign-in asks for it.
+    http.expectNone(`${API}/config/user-system`);
 
     gui.flush(GUI_PAYLOAD);
     amber.flush(AMBER_PAYLOAD);
-    userSystem.flush(USER_SYSTEM_PAYLOAD);
 
     await pending;
     expect(service.env.copilotEnabled).toBe(true);
     expect(service.env.limitColumns).toBe(42);
     expect(service.env.defaultDataTransferBatchSize).toBe(400);
-    expect(service.env.inviteOnly).toBe(true);
   });
 
   it("loadPostLogin preserves pre-login fields when both phases run", async () 
=> {
-    // Guards a refactor that overwrites the merged map with the 
gui/user-system
+    // Guards a refactor that overwrites the merged map with the gui/amber
     // response shape. Without this assertion, pre-login fields could silently
     // disappear from env after post-login completes.
     const preLoginPending = firstValueFrom(service.loadPreLogin());
@@ -127,7 +124,6 @@ describe("GuiConfigService", () => {
     const postLoginPending = firstValueFrom(service.loadPostLogin());
     http.expectOne(`${API}/config/gui`).flush(GUI_PAYLOAD);
     http.expectOne(`${API}/config/amber`).flush(AMBER_PAYLOAD);
-    http.expectOne(`${API}/config/user-system`).flush(USER_SYSTEM_PAYLOAD);
     await postLoginPending;
 
     expect(service.env.localLogin).toBe(true);
@@ -145,12 +141,11 @@ describe("GuiConfigService", () => {
     // the no-Authorization-header request would 403 and pollute network logs.
     http.expectNone(`${API}/config/gui`);
     http.expectNone(`${API}/config/amber`);
-    http.expectNone(`${API}/config/user-system`);
     await pending;
     expect(service.env.localLogin).toBe(true);
   });
 
-  it("load() chains /config/gui + /config/amber + /config/user-system when a 
token is stored", async () => {
+  it("load() chains /config/gui + /config/amber when a token is stored", async 
() => {
     localStorage.setItem(TOKEN_KEY, "stored-token");
     const pending = firstValueFrom(service.load());
 
@@ -158,7 +153,6 @@ describe("GuiConfigService", () => {
     // forkJoin fires all requests in parallel after pre-login resolves.
     http.expectOne(`${API}/config/gui`).flush(GUI_PAYLOAD);
     http.expectOne(`${API}/config/amber`).flush(AMBER_PAYLOAD);
-    http.expectOne(`${API}/config/user-system`).flush(USER_SYSTEM_PAYLOAD);
 
     await pending;
     expect(service.env.localLogin).toBe(true);
@@ -176,24 +170,20 @@ describe("GuiConfigService", () => {
     http.expectOne(`${API}/config/pre-login`).flush(PRE_LOGIN_PAYLOAD);
     const guiReq = http.expectOne(`${API}/config/gui`);
     const amberReq = http.expectOne(`${API}/config/amber`);
-    const userSystemReq = http.expectOne(`${API}/config/user-system`);
     guiReq.flush({}, { status: 403, statusText: "Forbidden" });
     // forkJoin tears down the sibling observables on first error, so the
-    // amber and user-system requests are already cancelled by the time we get
-    // here. Flushing a cancelled TestRequest throws.
+    // amber request is already cancelled by the time we get here. Flushing a
+    // cancelled TestRequest throws.
     if (!amberReq.cancelled) {
       amberReq.flush({}, { status: 403, statusText: "Forbidden" });
     }
-    if (!userSystemReq.cancelled) {
-      userSystemReq.flush({}, { status: 403, statusText: "Forbidden" });
-    }
 
     await pending;
     // Pre-login fields stay, post-login fields stay unset; the app degrades
     // rather than failing to start.
     expect(service.env.localLogin).toBe(true);
     expect(service.env.copilotEnabled).toBeUndefined();
-    expect(service.env.inviteOnly).toBeUndefined();
+    expect(service.env.defaultDataTransferBatchSize).toBeUndefined();
   });
 
   it("load() rejects when /config/pre-login itself fails so the bootstrap 
error is surfaced", async () => {
@@ -204,7 +194,6 @@ describe("GuiConfigService", () => {
     // catchError on the inner pipe must not catch the outer pre-login 
rejection.
     http.expectNone(`${API}/config/gui`);
     http.expectNone(`${API}/config/amber`);
-    http.expectNone(`${API}/config/user-system`);
     await expect(pending).rejects.toThrow(/pre-login configuration/);
   });
 
@@ -233,7 +222,6 @@ describe("GuiConfigService", () => {
     const postLoginPending = firstValueFrom(service.loadPostLogin());
     http.expectOne(`${API}/config/gui`).flush(GUI_PAYLOAD);
     http.expectOne(`${API}/config/amber`).flush(AMBER_PAYLOAD);
-    http.expectOne(`${API}/config/user-system`).flush(USER_SYSTEM_PAYLOAD);
     await postLoginPending;
 
     expect(service.env).not.toBe(before);
@@ -257,7 +245,6 @@ describe("GuiConfigService", () => {
     const postLoginPending = firstValueFrom(service.loadPostLogin());
     http.expectOne(`${API}/config/gui`).flush(GUI_PAYLOAD);
     http.expectOne(`${API}/config/amber`).flush(AMBER_PAYLOAD);
-    http.expectOne(`${API}/config/user-system`).flush(USER_SYSTEM_PAYLOAD);
     await postLoginPending;
 
     expect(service.env.workflowEmailNotificationEnabled).toBeUndefined();
@@ -268,20 +255,20 @@ describe("GuiConfigService", () => {
   it("env merges sources in MERGE_ORDER so a later source wins on a shared 
key", async () => {
     // The typed source payloads are disjoint, so precedence never fires 
through
     // the public API, but the merge reduce implements "later source wins" and
-    // nothing else covers it. Inject an overlapping key via the raw payloads 
to
-    // lock the documented order (preLogin, gui, amber, userSystem).
+    // nothing else covers it. Inject overlapping keys via the raw payloads to
+    // lock the documented order (preLogin, gui, amber).
     const preLoginPending = firstValueFrom(service.loadPreLogin());
-    http.expectOne(`${API}/config/pre-login`).flush({ ...PRE_LOGIN_PAYLOAD, 
inviteOnly: false });
+    http.expectOne(`${API}/config/pre-login`).flush({ ...PRE_LOGIN_PAYLOAD, 
copilotEnabled: false });
     await preLoginPending;
-    // userSystem comes after preLogin in MERGE_ORDER, so its value must win.
-    expect(service.env.inviteOnly).toBe(false);
+    expect(service.env.copilotEnabled).toBe(false);
 
     const postLoginPending = firstValueFrom(service.loadPostLogin());
-    http.expectOne(`${API}/config/gui`).flush(GUI_PAYLOAD);
+    http.expectOne(`${API}/config/gui`).flush({ ...GUI_PAYLOAD, 
defaultDataTransferBatchSize: 1 });
     http.expectOne(`${API}/config/amber`).flush(AMBER_PAYLOAD);
-    http.expectOne(`${API}/config/user-system`).flush({ inviteOnly: true });
     await postLoginPending;
 
-    expect(service.env.inviteOnly).toBe(true);
+    // gui comes after preLogin, and amber after gui, so the later value wins 
each time.
+    expect(service.env.copilotEnabled).toBe(true);
+    expect(service.env.defaultDataTransferBatchSize).toBe(400);
   });
 });
diff --git a/frontend/src/app/common/service/gui-config.service.ts 
b/frontend/src/app/common/service/gui-config.service.ts
index fb878783d5..1d4e42d839 100644
--- a/frontend/src/app/common/service/gui-config.service.ts
+++ b/frontend/src/app/common/service/gui-config.service.ts
@@ -36,15 +36,15 @@ type PreLoginConfig = Pick<
   | "appleLogin"
   | "defaultLocalUser"
   | "attributionEnabled"
+  | "inviteOnly"
   | "emailVerification"
 >;
 // Fields served by /config/amber.
 type AmberConfig = Pick<GuiConfig, "defaultDataTransferBatchSize">;
-type GuiOnlyConfig = Omit<GuiConfig, keyof PreLoginConfig | keyof AmberConfig 
| "inviteOnly">;
-type UserSystemConfig = Pick<GuiConfig, "inviteOnly">;
+type GuiOnlyConfig = Omit<GuiConfig, keyof PreLoginConfig | keyof AmberConfig>;
 
 // One entry per backend config endpoint.
-export type ConfigSource = "preLogin" | "gui" | "amber" | "userSystem";
+export type ConfigSource = "preLogin" | "gui" | "amber";
 
 @Injectable({ providedIn: "root" })
 export class GuiConfigService {
@@ -58,15 +58,15 @@ export class GuiConfigService {
   private mergedCache: GuiConfig | null = null;
 
   // Merge precedence when a key appears in multiple sources (later wins).
-  private static readonly MERGE_ORDER: ConfigSource[] = ["preLogin", "gui", 
"amber", "userSystem"];
+  private static readonly MERGE_ORDER: ConfigSource[] = ["preLogin", "gui", 
"amber"];
 
   constructor(private http: HttpClient) {}
 
   /**
    * APP_INITIALIZER entry point. Always loads /config/pre-login (anonymous). 
If
    * a JWT is already in localStorage (browser reload while logged in), chains
-   * /config/gui + /config/amber + /config/user-system in the same await so the
-   * full config is available before any post-login component mounts.
+   * /config/gui + /config/amber in the same await so the full config is
+   * available before any post-login component mounts.
    */
   load(): Observable<Partial<GuiConfig>> {
     return this.loadPreLogin().pipe(
@@ -108,12 +108,10 @@ export class GuiConfigService {
   loadPostLogin(): Observable<Partial<GuiConfig>> {
     const guiConfig$ = 
this.http.get<GuiOnlyConfig>(`${AppSettings.getApiEndpoint()}/config/gui`);
     const amberConfig$ = 
this.http.get<AmberConfig>(`${AppSettings.getApiEndpoint()}/config/amber`);
-    const userSystemConfig$ = 
this.http.get<UserSystemConfig>(`${AppSettings.getApiEndpoint()}/config/user-system`);
-    return forkJoin([guiConfig$, amberConfig$, userSystemConfig$]).pipe(
-      tap(([guiConfig, amberConfig, userSystemConfig]) => {
+    return forkJoin([guiConfig$, amberConfig$]).pipe(
+      tap(([guiConfig, amberConfig]) => {
         this.setSource("gui", guiConfig);
         this.setSource("amber", amberConfig);
-        this.setSource("userSystem", userSystemConfig);
       }),
       map(() => this.env)
     );
diff --git a/frontend/src/app/common/service/user/auth.service.spec.ts 
b/frontend/src/app/common/service/user/auth.service.spec.ts
index b2d054e806..aa04bbc67a 100644
--- a/frontend/src/app/common/service/user/auth.service.spec.ts
+++ b/frontend/src/app/common/service/user/auth.service.spec.ts
@@ -230,6 +230,29 @@ describe("AuthService", () => {
       expect(modal.info).toHaveBeenCalledTimes(1);
       expect(AuthService.getAccessToken()).toBeNull();
     });
+
+    // Admins can turn invite-only off while accounts are still waiting. Those 
accounts stay
+    // INACTIVE and every request they make is refused, so they keep the 
pending screen.
+    it("treats an inactive user as pending even while invite-only is off", () 
=> {
+      AuthService.setAccessToken("tok");
+      config.env.inviteOnly = false;
+      jwt.decodeToken.mockReturnValue({ ...claims, role: Role.INACTIVE });
+
+      const result = service.loginWithExistingToken();
+
+      expect(result).toBeUndefined();
+      httpMock.expectOne(r => r.url === 
`${api}/user/joining-reason/required`).flush(false);
+      expect(modal.info).toHaveBeenCalledTimes(1);
+      expect(AuthService.getAccessToken()).toBeNull();
+    });
+
+    it("signs in an account that is not inactive, whatever invite-only says", 
() => {
+      AuthService.setAccessToken("tok");
+      config.env.inviteOnly = true;
+
+      expect(service.loginWithExistingToken()?.role).toEqual(Role.REGULAR);
+      httpMock.expectNone(r => r.url === 
`${api}/user/joining-reason/required`);
+    });
   });
 
   // Every path that writes a credential supplies an address, so this should 
be unreachable — it
diff --git a/frontend/src/app/common/service/user/auth.service.ts 
b/frontend/src/app/common/service/user/auth.service.ts
index a8b5e517ea..b0a38654cf 100644
--- a/frontend/src/app/common/service/user/auth.service.ts
+++ b/frontend/src/app/common/service/user/auth.service.ts
@@ -227,7 +227,10 @@ export class AuthService {
       return undefined;
     }
 
-    if (this.config.env.inviteOnly && role === Role.INACTIVE) {
+    // INACTIVE means waiting for an admin, whatever the invite-only switch 
says now: an account that
+    // signed up while it was on stays INACTIVE after it is turned off, and 
every request it makes is
+    // refused, so it gets the pending screen rather than an empty dashboard.
+    if (role === Role.INACTIVE) {
       this.checkRegistrationRequired(uid).subscribe(required => {
         if (required) {
           this.openRegistrationModal(uid, email, name);
diff --git a/frontend/src/app/common/service/user/user.service.spec.ts 
b/frontend/src/app/common/service/user/user.service.spec.ts
index 6a38246626..192f00eac8 100644
--- a/frontend/src/app/common/service/user/user.service.spec.ts
+++ b/frontend/src/app/common/service/user/user.service.spec.ts
@@ -165,7 +165,7 @@ describe("UserService", () => {
   // ─── post-login config fetch coordination ─────────────────────────────────
 
   it("loads the authenticated config when a fresh login succeeds", async () => 
{
-    // /config/gui and /config/user-system are @RolesAllowed; their values must
+    // /config/gui and /config/amber are @RolesAllowed; their values must
     // be in memory before any post-login component reads config.env, otherwise
     // the dashboard renders against undefined flags.
     const spy = vi.spyOn(config, "loadPostLogin");
@@ -188,7 +188,7 @@ describe("UserService", () => {
     // Subscribers to userChanged (header, sidebar, routing guards) drive the
     // initial dashboard render. If userChanged fires before loadPostLogin
     // resolves, those subscribers see env without the authenticated fields and
-    // mis-render (e.g. copilot button missing, inviteOnly check skipped).
+    // mis-render (e.g. copilot button missing).
     const gate = new Subject<unknown>();
     vi.spyOn(config, "loadPostLogin").mockReturnValue(gate.asObservable() as 
any);
 
diff --git a/frontend/src/app/common/service/user/user.service.ts 
b/frontend/src/app/common/service/user/user.service.ts
index 0e7a272769..1efaf2177b 100644
--- a/frontend/src/app/common/service/user/user.service.ts
+++ b/frontend/src/app/common/service/user/user.service.ts
@@ -136,9 +136,10 @@ export class UserService {
 
   // Returns Observable<void> rather than void so callers (login / googleLogin 
/
   // register) can switchMap through the post-login config fetch. The 
/config/gui
-  // and /config/user-system endpoints are @RolesAllowed, so we must wait for 
the
-  // new JWT to be in localStorage before they will answer; 
loginWithExistingToken
-  // also reads config.env.inviteOnly, so it must run after loadPostLogin 
resolves.
+  // and /config/amber endpoints are @RolesAllowed, so we must wait for the
+  // new JWT to be in localStorage before they will answer; the user change 
that
+  // loginWithExistingToken feeds renders from that config, so it runs after
+  // loadPostLogin resolves.
   private handleAccessToken(accessToken: string): Observable<void> {
     AuthService.setAccessToken(accessToken);
     return this.config.loadPostLogin().pipe(
diff --git 
a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html
 
b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html
index 0c4b2e0c0a..982750eda1 100644
--- 
a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html
+++ 
b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html
@@ -399,3 +399,30 @@
     </button>
   </div>
 </nz-card>
+
+<nz-card nzTitle="Registration">
+  <div class="settings-row">
+    <span>Invite Only:</span>
+    <nz-switch [(ngModel)]="inviteOnly"></nz-switch>
+  </div>
+  <div class="help-text-number">
+    When on, a new account stays inactive until an admin approves it on the 
Users page. When off, anyone who signs up
+    gets a regular account right away, and regular accounts can run their own 
code in workflows. Accounts already
+    waiting for approval stay inactive until you approve them.
+  </div>
+
+  <div class="button-row">
+    <button
+      nz-button
+      nzType="primary"
+      (click)="saveRegistrationSettings()">
+      Save
+    </button>
+    <button
+      nz-button
+      nzType="default"
+      (click)="resetRegistrationSettings()">
+      Reset
+    </button>
+  </div>
+</nz-card>
diff --git 
a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts
 
b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts
index 4dfea1cd85..1be030b1f9 100644
--- 
a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts
+++ 
b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts
@@ -82,6 +82,7 @@ describe("AdminSettingsComponent", () => {
       model_max_number_of_concurrent_uploading_file_chunks: "4",
       model_multipart_upload_chunk_size_mib: "32",
       csv_parser_max_columns: "4096",
+      invite_only: "true",
     });
 
     expect(component.logoData).toBe("logo.png");
@@ -99,6 +100,28 @@ describe("AdminSettingsComponent", () => {
     expect(modelForm().maxConcurrentChunks).toBe(4);
     expect(modelForm().chunkSizeMiB).toBe(32);
     expect(component.csvMaxColumns).toBe(4096);
+    expect(component.inviteOnly).toBe(true);
+  });
+
+  it("reads invite-only as off for a stored false", () => {
+    httpTestingController.expectOne(SETTINGS_URL).flush({ invite_only: "false" 
});
+
+    expect(component.inviteOnly).toBe(false);
+  });
+
+  // The backend reads the row trimmed and case-insensitively, so the switch 
has to agree with it.
+  it("reads a padded or upper-case false as off", () => {
+    httpTestingController.expectOne(SETTINGS_URL).flush({ invite_only: " FALSE 
" });
+
+    expect(component.inviteOnly).toBe(false);
+  });
+
+  // Anything but false leaves sign-up closed on the backend too (an 
unreadable value falls back to
+  // the default, on), so the switch shows on rather than inviting a Save that 
opens sign-up.
+  it("reads a value that is not false as on", () => {
+    httpTestingController.expectOne(SETTINGS_URL).flush({ invite_only: 
"sometimes" });
+
+    expect(component.inviteOnly).toBe(true);
   });
 
   it("keeps the initializer defaults for missing or unparsable values", () => {
@@ -112,6 +135,8 @@ describe("AdminSettingsComponent", () => {
     // The model default is the 2 GiB ceiling #8000 gave models, not the 
dataset's 20 MiB.
     expect(modelForm().maxFileSizeMiB).toBe(2048);
     expect(component.csvMaxColumns).toBe(512);
+    // On is the default and the safe side: Save writes whatever the switch 
shows.
+    expect(component.inviteOnly).toBe(true);
   });
 
   it("surfaces a load failure through the message service", () => {
@@ -475,6 +500,72 @@ describe("AdminSettingsComponent", () => {
       });
     });
 
+    describe("registration settings", () => {
+      it("saveRegistrationSettings PUTs the invite-only switch and notifies 
success", () => {
+        completeLoad({ invite_only: "false" });
+        component.inviteOnly = true;
+
+        component.saveRegistrationSettings();
+
+        const req = httpTestingController.expectOne(updateUrl("invite_only"));
+        expect(req.request.method).toBe("PUT");
+        expect(req.request.body).toEqual({ value: "true" });
+        req.flush(null);
+
+        expect(notifySuccess).toHaveBeenCalledWith("Registration settings 
saved.");
+      });
+
+      it("saveRegistrationSettings writes false once the switch is turned 
off", () => {
+        completeLoad({ invite_only: "true" });
+        component.inviteOnly = false;
+
+        component.saveRegistrationSettings();
+
+        const req = httpTestingController.expectOne(updateUrl("invite_only"));
+        expect(req.request.body).toEqual({ value: "false" });
+        req.flush(null);
+      });
+
+      // A failed load leaves the switch at its initializer rather than the 
stored value, and saving
+      // that would overwrite the admin's choice of who may sign up.
+      it("saveRegistrationSettings refuses to save before the bulk load 
completes", () => {
+        const pending = httpTestingController.expectOne(SETTINGS_URL);
+
+        component.saveRegistrationSettings();
+
+        httpTestingController.expectNone((req: { method: string }) => 
req.method === "PUT");
+        expect(msgError).toHaveBeenCalledWith("Settings have not loaded; 
refresh before saving.");
+        pending.flush({});
+      });
+
+      it("saveRegistrationSettings notifies an error when the request fails", 
() => {
+        completeLoad();
+
+        component.saveRegistrationSettings();
+
+        
httpTestingController.expectOne(updateUrl("invite_only")).flush("boom", 
HTTP_ERROR);
+        expect(notifyError).toHaveBeenCalledWith("Could not save registration 
settings.");
+      });
+
+      it("resetRegistrationSettings POSTs a reset and notifies info", () => {
+        completeLoad();
+
+        component.resetRegistrationSettings();
+
+        httpTestingController.expectOne(resetUrl("invite_only")).flush(null);
+        expect(notifyInfo).toHaveBeenCalledWith("Resetting registration 
settings...");
+      });
+
+      it("resetRegistrationSettings notifies an error when the reset fails", 
() => {
+        completeLoad();
+
+        component.resetRegistrationSettings();
+
+        httpTestingController.expectOne(resetUrl("invite_only")).flush("boom", 
HTTP_ERROR);
+        expect(notifyError).toHaveBeenCalledWith("Could not reset registration 
settings.");
+      });
+    });
+
     describe("onFileChange", () => {
       it("rejects a non-image file with an error and leaves the existing logo 
untouched", () => {
         completeLoad();
@@ -638,16 +729,26 @@ describe("AdminSettingsComponent wiring", () => {
     it("gives every switch its own setting, in template order", () => {
       // The point of the test: workflow_enabled/workflows_enabled and 
dataset_enabled/
       // datasets_enabled are one character apart, and a swap between them is 
invisible on screen.
-      expect(switches().length).toBe(SWITCH_KEYS.length);
+      // The Registration card's invite-only switch renders after every tab 
switch.
+      expect(switches().length).toBe(SWITCH_KEYS.length + 1);
+      const inviteOnlySwitch = SWITCH_KEYS.length;
 
       SWITCH_KEYS.forEach((key, i) => {
         SWITCH_KEYS.forEach(k => ((component.sidebarTabs as any)[k] = false));
+        component.inviteOnly = false;
 
         switches()[i].triggerEventHandler("ngModelChange", true);
 
         const flipped = SWITCH_KEYS.filter(k => (component.sidebarTabs as 
any)[k]);
         expect(flipped).toEqual([key]);
+        expect(component.inviteOnly).toBe(false);
       });
+
+      SWITCH_KEYS.forEach(k => ((component.sidebarTabs as any)[k] = false));
+      switches()[inviteOnlySwitch].triggerEventHandler("ngModelChange", true);
+
+      expect(component.inviteOnly).toBe(true);
+      expect(SWITCH_KEYS.filter(k => (component.sidebarTabs as 
any)[k])).toEqual([]);
     });
 
     it("locks the Hub children until Hub itself is on", () => {
@@ -723,9 +824,10 @@ describe("AdminSettingsComponent wiring", () => {
         saveTabs: vi.spyOn(component, "saveTabs").mockImplementation(() => {}),
         saveUploadSettings: vi.spyOn(component, 
"saveUploadSettings").mockImplementation(() => {}),
         saveCsvSettings: vi.spyOn(component, 
"saveCsvSettings").mockImplementation(() => {}),
+        saveRegistrationSettings: vi.spyOn(component, 
"saveRegistrationSettings").mockImplementation(() => {}),
       };
       const saves = buttonsLabelled("Save");
-      expect(saves.length).toBe(2 + component.uploadGroups.length + 1);
+      expect(saves.length).toBe(2 + component.uploadGroups.length + 2);
 
       saves.forEach(b => b.click());
 
@@ -734,6 +836,7 @@ describe("AdminSettingsComponent wiring", () => {
       // Each upload card passes its own group, so the two cards cannot save 
each other's keys.
       expect(spies.saveUploadSettings.mock.calls.map(call => 
call[0])).toEqual(component.uploadGroups);
       expect(spies.saveCsvSettings).toHaveBeenCalledTimes(1);
+      expect(spies.saveRegistrationSettings).toHaveBeenCalledTimes(1);
     });
 
     it("routes each card's Reset to that card's own handler", () => {
@@ -742,9 +845,10 @@ describe("AdminSettingsComponent wiring", () => {
         resetTabs: vi.spyOn(component, "resetTabs").mockImplementation(() => 
{}),
         resetUploadSettings: vi.spyOn(component, 
"resetUploadSettings").mockImplementation(() => {}),
         resetCsvSettings: vi.spyOn(component, 
"resetCsvSettings").mockImplementation(() => {}),
+        resetRegistrationSettings: vi.spyOn(component, 
"resetRegistrationSettings").mockImplementation(() => {}),
       };
       const resets = buttonsLabelled("Reset");
-      expect(resets.length).toBe(2 + component.uploadGroups.length + 1);
+      expect(resets.length).toBe(2 + component.uploadGroups.length + 2);
 
       resets.forEach(b => b.click());
 
@@ -752,6 +856,7 @@ describe("AdminSettingsComponent wiring", () => {
       expect(spies.resetTabs).toHaveBeenCalledTimes(1);
       expect(spies.resetUploadSettings.mock.calls.map(call => 
call[0])).toEqual(component.uploadGroups);
       expect(spies.resetCsvSettings).toHaveBeenCalledTimes(1);
+      expect(spies.resetRegistrationSettings).toHaveBeenCalledTimes(1);
     });
   });
 
diff --git 
a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.ts
 
b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.ts
index c91a15141c..22f8b29cc1 100644
--- 
a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.ts
+++ 
b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.ts
@@ -124,6 +124,10 @@ export class AdminSettingsComponent implements OnInit {
 
   csvMaxColumns: number = 512;
 
+  // Whether a new account waits for an admin's approval (the `invite_only` 
setting). On is the
+  // default and the safe side, since Save writes whatever the switch shows.
+  inviteOnly: boolean = true;
+
   // S3 Multipart Upload Constraints
   readonly MIN_PART_SIZE_MiB = 5; // 5 MiB minimum for parts (except last part)
   readonly MAX_PART_SIZE_MiB = 5120; // 5 GiB maximum per part (5 * 1024 MiB)
@@ -176,6 +180,9 @@ export class AdminSettingsComponent implements OnInit {
             form.chunkSizeMiB = 
parseIntOrDefault(settings[endpoint.chunkSizeSettingKey], form.chunkSizeMiB);
           });
           this.csvMaxColumns = 
parseIntOrDefault(settings["csv_parser_max_columns"], this.csvMaxColumns);
+          // Only an explicit false opens sign-up on the backend, which reads 
the row trimmed and
+          // case-insensitively and falls back to on for anything it cannot 
read.
+          this.inviteOnly = (settings["invite_only"] ?? 
"").trim().toLowerCase() !== "false";
           this.settingsLoaded = true;
         },
         error: () => this.message.error("Failed to load settings."),
@@ -360,4 +367,31 @@ export class AdminSettingsComponent implements OnInit {
     this.notificationService.info("Resetting result panel settings...");
     setTimeout(() => window.location.reload(), this.RELOAD_DELAY);
   }
+
+  saveRegistrationSettings(): void {
+    // Without a completed load the switch shows its initializer rather than 
the stored value.
+    if (!this.settingsLoaded) {
+      this.message.error("Settings have not loaded; refresh before saving.");
+      return;
+    }
+    this.adminSettingsService
+      .updateSetting("invite_only", this.inviteOnly.toString())
+      .pipe(untilDestroyed(this))
+      .subscribe({
+        next: () => this.notificationService.success("Registration settings 
saved."),
+        error: () => this.notificationService.error("Could not save 
registration settings."),
+      });
+  }
+
+  resetRegistrationSettings(): void {
+    this.adminSettingsService
+      .resetSetting("invite_only")
+      .pipe(untilDestroyed(this))
+      .subscribe({
+        error: () => this.notificationService.error("Could not reset 
registration settings."),
+      });
+
+    this.notificationService.info("Resetting registration settings...");
+    setTimeout(() => window.location.reload(), this.RELOAD_DELAY);
+  }
 }
diff --git a/frontend/src/app/hub/component/login/texera-login.component.html 
b/frontend/src/app/hub/component/login/texera-login.component.html
index 7afcbc0056..40b9da2f98 100644
--- a/frontend/src/app/hub/component/login/texera-login.component.html
+++ b/frontend/src/app/hub/component/login/texera-login.component.html
@@ -141,8 +141,9 @@
       nz-typography
       nzType="secondary"
       class="hint">
-      Password must be at least 6 characters. After registering, contact the 
Texera administrator to activate your
-      account.
+      Password must be at least 6 characters. @if (config.env.inviteOnly) {
+      <span>After registering, contact the Texera administrator to activate 
your account.</span>
+      }
     </p>
 
     <!-- Present from the outset where verification is on, so the code reads 
as part of signing up
diff --git 
a/frontend/src/app/hub/component/login/texera-login.component.spec.ts 
b/frontend/src/app/hub/component/login/texera-login.component.spec.ts
index 6a25580bb2..d1fd7040cb 100644
--- a/frontend/src/app/hub/component/login/texera-login.component.spec.ts
+++ b/frontend/src/app/hub/component/login/texera-login.component.spec.ts
@@ -33,6 +33,7 @@ import { MockGuiConfigService } from 
"../../../common/service/gui-config.service
 import { commonTestProviders } from "../../../common/testing/test-utils";
 import { USER_WORKFLOW } from "../../../app-routing.constant";
 import { ORCID_STATE_KEY } from 
"../../../common/service/user/orcid-auth.service";
+import { Role, User } from "../../../common/type/user";
 import { By } from "@angular/platform-browser";
 import { NzIconDirective } from "ng-zorro-antd/icon";
 import { NzTabsComponent } from "ng-zorro-antd/tabs";
@@ -56,6 +57,7 @@ describe("TexeraLoginComponent", () => {
     authState$ = new Subject<SocialUser | null>();
     userServiceMock = {
       isLogin: vi.fn().mockReturnValue(false),
+      getCurrentUser: vi.fn().mockReturnValue(undefined),
       login: vi.fn().mockReturnValue(of(undefined)),
       register: vi.fn().mockReturnValue(of({ verificationRequired: false })),
       registerVerify: vi.fn().mockReturnValue(of(undefined)),
@@ -347,6 +349,54 @@ describe("TexeraLoginComponent", () => {
       expect(notificationServiceMock.success).toHaveBeenCalled();
     });
 
+    const fillSignup = () =>
+      component.form.patchValue({
+        username: "alice",
+        email: "[email protected]",
+        password: "secret1",
+        confirm: "secret1",
+      });
+    const signedInAs = (role: Role) =>
+      (userServiceMock.getCurrentUser as any).mockReturnValue({ uid: 7, name: 
"alice", role } as User);
+
+    // With invite-only off the account is REGULAR and registering has already 
signed the user in,
+    // so the page goes where a sign-in would rather than telling them to wait 
for an admin.
+    it("opens the dashboard when the new account can be used at once", () => {
+      signedInAs(Role.REGULAR);
+      fillSignup();
+
+      component.submit();
+
+      expect(notificationServiceMock.success).toHaveBeenCalledWith("Your 
account has been created.");
+      expect(routerMock.navigateByUrl).toHaveBeenCalledWith(USER_WORKFLOW);
+    });
+
+    // With invite-only on the account is INACTIVE, and signing in with it 
signs straight back out.
+    it("asks the user to wait for an admin when the new account is not signed 
in", () => {
+      fillSignup();
+
+      component.submit();
+
+      expect(notificationServiceMock.success).toHaveBeenCalledWith(
+        "Your account has been created. Please contact the Texera 
administrator to activate your account."
+      );
+      expect(routerMock.navigateByUrl).not.toHaveBeenCalled();
+    });
+
+    // An INACTIVE account can do nothing yet, so even a session that is still 
around for one is not
+    // sent to the dashboard.
+    it("does not open the dashboard for an INACTIVE account", () => {
+      signedInAs(Role.INACTIVE);
+      fillSignup();
+
+      component.submit();
+
+      expect(notificationServiceMock.success).toHaveBeenCalledWith(
+        "Your account has been created. Please contact the Texera 
administrator to activate your account."
+      );
+      expect(routerMock.navigateByUrl).not.toHaveBeenCalled();
+    });
+
     // Where verification is on the code field is present from the outset, and 
mailing the code is
     // its own button. Signing up is then a single submit that carries the 
code, rather than a first
     // submit that silently sent mail and a second that completed.
@@ -432,6 +482,30 @@ describe("TexeraLoginComponent", () => {
         expect(notificationServiceMock.success).toHaveBeenCalled();
       });
 
+      it("opens the dashboard once the code completes a sign-up that can be 
used at once", () => {
+        signedInAs(Role.REGULAR);
+        fillForm();
+        component.form.patchValue({ code: "123456" });
+
+        component.submit();
+
+        expect(notificationServiceMock.success).toHaveBeenCalledWith("Your 
account has been created.");
+        expect(routerMock.navigateByUrl).toHaveBeenCalledWith(USER_WORKFLOW);
+      });
+
+      // The button only shows where the config says verification is on. A 
server that disagrees has
+      // just created the account outright, and that sign-up ends like any 
other.
+      it("ends the sign-up when the server created the account without a 
code", () => {
+        (userServiceMock.register as any).mockReturnValue(of({ 
verificationRequired: false }));
+        signedInAs(Role.REGULAR);
+        fillForm();
+
+        component.sendCode();
+
+        expect(notificationServiceMock.success).toHaveBeenCalledWith("Your 
account has been created.");
+        expect(routerMock.navigateByUrl).toHaveBeenCalledWith(USER_WORKFLOW);
+      });
+
       it("asks for the code rather than submitting an empty one", () => {
         fillForm();
 
@@ -743,12 +817,23 @@ describe("TexeraLoginComponent", () => {
 
         expect(input("email")).toBeTruthy();
         expect(input("confirm")).toBeTruthy();
+        // Invite-only is off in the default config, so there is no approval 
to wait for.
         expect(host().querySelector("p.hint")?.textContent?.replace(/\s+/g, " 
").trim()).toBe(
-          "Password must be at least 6 characters. After registering, contact 
the Texera administrator to activate your account."
+          "Password must be at least 6 characters."
         );
         expect(submitButton()?.textContent?.trim()).toBe("Sign up");
       });
 
+      it("says an admin has to activate the account while invite-only is on", 
() => {
+        (TestBed.inject(GuiConfigService) as unknown as 
MockGuiConfigService).setConfig({ inviteOnly: true });
+        component.setMode("signup");
+        fixture.detectChanges();
+
+        expect(host().querySelector("p.hint")?.textContent?.replace(/\s+/g, " 
").trim()).toBe(
+          "Password must be at least 6 characters. After registering, contact 
the Texera administrator to activate your account."
+        );
+      });
+
       it("switches mode from the tab strip in both directions", () => {
         const tabs = fixture.debugElement.query(By.css("nz-tabs"));
 
diff --git a/frontend/src/app/hub/component/login/texera-login.component.ts 
b/frontend/src/app/hub/component/login/texera-login.component.ts
index 088fb6accf..51b90dd6a5 100644
--- a/frontend/src/app/hub/component/login/texera-login.component.ts
+++ b/frontend/src/app/hub/component/login/texera-login.component.ts
@@ -38,6 +38,7 @@ import { AppleAuthService } from 
"../../../common/service/user/apple-auth.servic
 import { NotificationService } from 
"../../../common/service/notification/notification.service";
 import { GuiConfigService } from "../../../common/service/gui-config.service";
 import { USER_WORKFLOW } from "../../../app-routing.constant";
+import { Role } from "../../../common/type/user";
 import { NzIconDirective } from "ng-zorro-antd/icon";
 import { NzTabComponent, NzTabsComponent } from "ng-zorro-antd/tabs";
 import { NzInputDirective, NzInputGroupComponent, 
NzInputGroupWhitSuffixOrPrefixDirective } from "ng-zorro-antd/input";
@@ -58,10 +59,13 @@ function reasonFor(e: unknown): string | undefined {
   return (e as HttpErrorResponse)?.error?.message ?? (e as Error)?.message;
 }
 
-/** Reported by every path that ends with an account existing. */
-const ACCOUNT_CREATED =
+/** Reported when a sign-up leaves the account waiting for an admin's approval 
(invite-only). */
+const ACCOUNT_PENDING =
   "Your account has been created. Please contact the Texera administrator to 
activate your account.";
 
+/** Reported when a sign-up has already signed the user in. */
+const ACCOUNT_READY = "Your account has been created.";
+
 type LoginMode = "signin" | "signup";
 
 /**
@@ -292,9 +296,11 @@ export class TexeraLoginComponent implements OnInit {
       .subscribe(({ verificationRequired }) => {
         // The button is only rendered where the config says verification is 
on. If the server
         // disagrees, `register` has just created the account outright and 
there is no code coming.
-        this.notificationService.success(
-          verificationRequired ? `A verification code has been sent to 
${fields.email}.` : ACCOUNT_CREATED
-        );
+        if (verificationRequired) {
+          this.notificationService.success(`A verification code has been sent 
to ${fields.email}.`);
+        } else {
+          this.finishSignup();
+        }
       });
   }
 
@@ -326,7 +332,7 @@ export class TexeraLoginComponent implements OnInit {
           }),
           untilDestroyed(this)
         )
-        .subscribe(() => this.notificationService.success(ACCOUNT_CREATED));
+        .subscribe(() => this.finishSignup());
       return;
     }
 
@@ -339,7 +345,23 @@ export class TexeraLoginComponent implements OnInit {
         }),
         untilDestroyed(this)
       )
-      .subscribe(() => this.notificationService.success(ACCOUNT_CREATED));
+      .subscribe(() => this.finishSignup());
+  }
+
+  /**
+   * Close a sign-up that created the account. Registering signs the user in, 
so an account that can
+   * already be used (invite-only off) goes where a sign-in would. An account 
waiting for an admin is
+   * INACTIVE, which signs the session straight back out, so the user stays 
here and is told to wait.
+   * The role is checked as well, so an INACTIVE session is never sent to the 
dashboard.
+   */
+  private finishSignup(): void {
+    const user = this.userService.getCurrentUser();
+    if (user !== undefined && user.role !== Role.INACTIVE) {
+      this.notificationService.success(ACCOUNT_READY);
+      this.navigateAfterLogin();
+    } else {
+      this.notificationService.success(ACCOUNT_PENDING);
+    }
   }
 
   /**

Reply via email to