Let the creator choose the new org's apps

FeatureSecurityService
Shipped
August 15, 2026 at 3:53 AM UTC
Author
Kamo
Commit
cfcc12f

The network-create wizard gains an Apps & Features step, and this is the half that makes it real. /branch-types/creatable now describes the apps each branch type's security model offers -- forced ones as `required`, OPTIONAL_* ones with the model's own default -- so the wizard can render the step before the org exists. It has to come from here: the endpoints that describe apps are scoped to an existing org and gated on CONFIGURE_SYSTEM, a right the person creating a branch frequently does not hold in the parent org. NOT_AVAILABLE apps are omitted entirely rather than shown greyed out. The create payload gains `appSelections` ({ServiceType: boolean}), and the new org is provisioned from it in the create transaction, next to the role-template seeding: same kind of thing, and either it all lands or the org is not created. The part worth reading twice is that an app being switched OFF still gets an OrgFeature row. Until now a new org got no feature rows at all and they were filled in lazily the first time anyone opened Settings -> Apps -- a loop that enables everything the model does not outright block. So OPTIONAL_DEFAULT_DISABLED, an admin explicitly saying "offer this, but start it off", was silently promoted to ON for every child org ever created. Writing an inactive row is what makes the choice stick, because that loop only creates rows for types it finds none for. It is also why this cannot be a best-effort afterCommit step: the fallback would not leave the apps unset, it would leave them set to the opposite of what the creator asked for. Deliberately narrow in three places. An org with no applied model is left on the lazy path -- computeAvailabilitiesMap answers OPTIONAL_DEFAULT_DISABLED for everything there, and materialising that would hand someone a workspace where nothing is on and nothing says why. A selection naming an app the model does not offer is ignored, not refused: the wizard keeps its draft in session storage, so an admin narrowing the model mid-session must not cost a customer their create. And a null appSelections is not "no apps" -- it is an older client, and every app falls back to the model default.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing