fix(api): group-scoped forms unreachable on public route

Open
#2,012 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api, authorization

Research direction

Read packages/api/src/routes/forms.ts:38-42 and 92-99, then compare the events route's group-scope handling and spec §5.5. Run packages/api/src/routes/forms.test.ts and add coverage for group-scoped reads and submissions. Done means the behavior is fixed and tested, or the admin-only decision is documented in the spec.

Written by the indexing model from the issue text.

Description

Summary

GET /forms/:slug and POST /forms/:slug/submissions collapse scope='group' to the same handling as scope='staff_only' — only staff (systemTier >= 1) can read or submit. A group-scoped form should be visible to chairs/members of the attached group, not just staff.

Requirements

  • Decide intentional or fix: per spec §5.5, group scope is "restricted to a specific group's members"
  • If fixing: when form.scope === 'group', plumb a group-membership check using actor.chairedGroupIds + a query for group_memberships against the attached group_id
  • If intentional (admin-only by design), document in the spec
  • Update tests in packages/api/src/routes/forms.test.ts to cover the group-scoped path

Context

Surfaced in the Plan 4 review (PR #2011). The events route has parallel logic for group scope; forms should match.

Files

  • packages/api/src/routes/forms.ts:38-42, 92-99
Dominant language
HTML
Stars
33
Forks
104
Avg merge
12h 3m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from USRSE/usrse.github.io

All issues in USRSE/usrse.github.io

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.