SIGN IN SIGN UP

(core) Cap free team sites at 10 members

Summary:
Adds a maxUsersPerOrg feature and sets it to 10 on the free team plan.

The cap counts billable org members: users in a non-guest org group, minus
consultants and special users. Workspace and document sharing is unaffected, and
stays governed by maxSharesPerWorkspace and maxSharesPerDoc.

On a site that is at or over the limit, adding a new member is forbidden.
Removing or changing roles is permitted, as for other similar limits. SCIM is
another way to change who is in an org and is not reconciled with any of this
(it is off unless GRIST_ENABLE_SCIM is set, and then open only to an install
admin or to the single account named by GRIST_SCIM_EMAIL).

The member count is reported to the client on the active session's org, only
when the plan caps members, and only to owners and billing account managers.
At the limit they get a dismissible banner, over it one they cannot dismiss.
Everyone else is told only that the site is over its limit, which is all an
editor's banner needs: it names no figures and points at the site owner.
Viewers are shown nothing.

Steps are taken to optimize calculation and caching of member counts.

Free team sites over the limit are intended to be read-only. This change does
not immediately do that, but prepares and tests a flag for it. This
functionality will be turned on at the right time in a small follow-up.

Sites are already held read-only for a suspended plan, or a subscription in
arrears, with inconsistent banners. Rather than add a third, we unify. The
subscription banner, which had some read-only handling, is reorganized, and a
redundant suspended-site toast is removed. The banner is now shown to everyone
on the site, though only owners and billing managers are told why.

Test Plan: added/updated tests

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D5041
P
Paul Fitzpatrick committed
99391c9e54d91c750bf576fb35c184113f1d9a99
Parent: 5d9bfe5