Skip to content

feat(marketplace): per-person marketplace access control backend#8505

Open
LWS49 wants to merge 1 commit into
lws49/feat-marketplace-pr6a-factoriesfrom
lws49/feat-marketplace-pr6b-backend
Open

feat(marketplace): per-person marketplace access control backend#8505
LWS49 wants to merge 1 commit into
lws49/feat-marketplace-pr6a-factoriesfrom
lws49/feat-marketplace-pr6b-backend

Conversation

@LWS49

@LWS49 LWS49 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Gates assessment-marketplace browsing per person instead of per current-course role. A typed allow-list - specific user, whole instance, email domain, or everyone - grants access to baseline-capable users, meaning anyone who manages or owns a course anywhere or is an instance instructor/administrator. Per-user access blocks override the allow-list. This PR adds the models and migrations, the matching and audit queries, the ability component that gates :access_marketplace, and the System::Admin endpoints the following PRs consume. No UI yet.

Design decisions

  • One rules table with a rule_type discriminator rather than a table per rule kind - the types share every field that matters and differ only in which target column is set, so separate tables would duplicate the CRUD, serialization and matching code for no gain.
  • Access blocks are a separate override table rather than rule deletion - a block has to outlive the rule that currently matches the person, otherwise re-adding a domain rule silently restores access to someone an admin deliberately removed.
  • Baseline eligibility is computed, not stored - it follows course and instance roles that change constantly, so a cached flag would go stale the moment someone is made a course manager.
  • Per-type uniqueness is enforced by partial indexes, not by validation alone - two admins adding the same domain rule concurrently would otherwise both succeed.

Regression prevention

Covers: rule creation per type and rejection of duplicates, resolution of an email to its owning user, everyone-mode reporting, rule deletion, preview counts including blocked matches and their ordering, access-list annotation and serialization, block create and destroy, ability gating for eligible, ineligible and blocked users, and the user baseline predicates.

@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr6b-backend branch from c1b9c90 to b0b796d Compare July 22, 2026 05:22
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr6a-factories branch from f8c6959 to 8e63f2b Compare July 22, 2026 05:39
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
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr6b-backend branch from b0b796d to c7e43f9 Compare July 22, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant