Skip to content

feat(members): let a member fully manage a single form#194

Merged
Musiker15 merged 1 commit into
mainfrom
feat/per-form-manager
Jul 9, 2026
Merged

feat(members): let a member fully manage a single form#194
Musiker15 merged 1 commit into
mainfrom
feat/per-form-manager

Conversation

@Musiker15

Copy link
Copy Markdown
Member

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_manage boolean (+ hand-written migration). A row with can_manage = true is a per-form manager; review-only rows are unchanged.

Access

  • manageScopeFromRole (pure) + getManageScope / canManageForm in lib/guild. Guild managers (owner/admin) manage everything; other members manage only their granted forms.
  • The per-form edit, delete and definition-export routes and the edit and preview pages are now gated on canManageForm instead of guild-wide canManageForms.
  • The forms list shows the edit/preview/delete/export-JSON buttons per form based on the manage scope. Guild-only actions (new form, import, billing, guild settings) stay guild-gated.

Members UI

  • Per-form access is now a None / Review / Manage select (was a review-only checkbox).
  • The grants API accepts { 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.

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.
@Musiker15 Musiker15 force-pushed the feat/per-form-manager branch from e690762 to 540ad1b Compare July 9, 2026 14:48
@Musiker15 Musiker15 merged commit de12726 into main Jul 9, 2026
3 checks passed
@Musiker15 Musiker15 deleted the feat/per-form-manager branch July 9, 2026 14:51
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