feat(marketplace): typed allow-list gate with open-to-everyone toggle#8485
Closed
LWS49 wants to merge 4 commits into
Closed
feat(marketplace): typed allow-list gate with open-to-everyone toggle#8485LWS49 wants to merge 4 commits into
LWS49 wants to merge 4 commits into
Conversation
LWS49
force-pushed
the
lws49/feat-marketplace-pr5b-misc
branch
from
July 17, 2026 07:27
2fce896 to
a3e493d
Compare
LWS49
force-pushed
the
lws49/feat-marketplace-pr6-allowlist
branch
from
July 17, 2026 07:30
b27c3d2 to
0a3cc59
Compare
LWS49
force-pushed
the
lws49/feat-marketplace-pr5b-misc
branch
2 times, most recently
from
July 17, 2026 08:14
3bc206d to
909976b
Compare
LWS49
force-pushed
the
lws49/feat-marketplace-pr6-allowlist
branch
2 times, most recently
from
July 19, 2026 07:48
a8e79a4 to
74cd623
Compare
Specs commit (use_transactional_fixtures is false), so a bare per-second timestamp collides whenever two rspec processes start within the same second, tripping unique constraints. Append a random suffix per process.
Lift the instance picker out of InstanceDropdown into a reusable core field so the marketplace allow-list rule form can share it.
Gate assessment-marketplace browsing per person rather than per current-course role. A typed allow-list (user / instance / email-domain / everyone rules) grants access to baseline-capable users (course manager/owner or instance instructor/admin anywhere), with individual access blocks as overrides. - AllowlistRule and AccessBlock models, migrations, and per-type uniqueness - RuleMatchQuery / RulePreviewQuery / AccessListQuery for matching and audit - ability component gates :access_marketplace on the allow-list minus blocks - User baseline predicates and delete-user FK handling for both tables - System::Admin CRUD, access-list, and block/unblock endpoints
System::Admin page to manage the marketplace allow-list and per-user access. Add/remove typed rules with live preview of who a rule would let in, an access audit list filterable by status and granting rule, and block/unblock controls.
LWS49
force-pushed
the
lws49/feat-marketplace-pr6-allowlist
branch
from
July 20, 2026 15:28
74cd623 to
93cb96c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Marketplace visibility is currently all-or-nothing, which blocks a staged rollout. This PR gates the marketplace behind a global typed allow-list: course managers/owners only see it if a rule matches them (specific user, whole instance, or email domain), while system administrators always retain access. It adds a self-serve System::Admin page to manage the rules, and a deliberate, reversible "open to everyone" mode that opens the marketplace to all course managers everywhere in one action without discarding the scoped rules built up during the staged rollout.
Design decisions
rule_typeenum (user / instance / email_domain / everyone) - a single pool keeps administration in one place, and instance rules still scope per-instance naturally because the match goes throughuser.instance_users, which is tenant-scoped at query timeeveryonerow, disable deletes it, so scoped rules survive a temporary opening untouched and the existing create/destroy endpoints are reused with no new routeseveryonerow, enforced by a model uniqueness validation paired with a partial unique DB indexRegression prevention
grants_access?matching for user rules, instance rules (including per-instance scoping under the current tenant), case-insensitive email-domain rules, the everyone rule, and nil-user denialeveryoneRuleId, everyone row excluded from the scoped list), and rejection of a second everyone rule with 400