feat(members): let a member fully manage a single form#194
Merged
Conversation
Adds a per-form manage grant so a viewer can be given full management of one
specific form (edit the form and handle its submissions) without becoming a
guild-wide manager. The grant lives on form_reviewers via a new can_manage
column; a manage grant implies review access.
- schema: form_reviewers.can_manage (+ migration)
- access: manageScopeFromRole + getManageScope/canManageForm in lib/guild
- gate the per-form edit, delete and definition-export routes + the edit and
preview pages on canManageForm (guild manager OR per-form manager)
- forms list shows the edit/preview/delete/export buttons per form based on the
manage scope; guild-only actions (new form, import, billing) stay guild-gated
- members UI: per-form access is now a None/Review/Manage select; the grants API
accepts { grants: [{ formId, manage }] } (legacy formIds still accepted)
Localized in all 7 languages. Added access-scope unit tests.
e690762 to
540ad1b
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.
Customer request: be able to set a person to fully manage only a certain form (not the whole guild).
What changed
A new per-form manage grant. A viewer can be given full management of one specific form (edit the form in the builder and handle its submissions) without becoming a guild-wide manager. A manage grant implies review access.
Model
form_reviewers.can_manageboolean (+ hand-written migration). A row withcan_manage = trueis a per-form manager; review-only rows are unchanged.Access
manageScopeFromRole(pure) +getManageScope/canManageForminlib/guild. Guild managers (owner/admin) manage everything; other members manage only their granted forms.canManageForminstead of guild-widecanManageForms.Members UI
{ grants: [{ formId, manage }] }; the legacy{ formIds }body is still accepted (review-only).Localized in all 7 languages. Added unit tests for the manage scope. Typecheck, lint, tests (web 43) and build all green. Migration applies via the deploy
prisma migrate deploy.How to use
Set the person's role to Viewer, then on the Members tab pick Manage for the one form they should run.