Skip to content

Approve/reject collaboration requests not scoped to route document or pending status #46

Description

@Alimedhat000

Problem

approveRequest / rejectRequest (server/src/controllers/document.controller.ts:713-716, :787) update requests by bare requestId from the body without verifying it belongs to req.params.id, and never check status === 'pending'. Nonexistent ids surface as Prisma 500s.

Impact

Requests can be approved/rejected through the wrong document route; already-decided requests can be re-decided.

Fix

Scope writes with updateMany({ where: { id: requestId, documentId: params.id, status: 'pending' } }) and treat zero matches as 404/409.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/highHigh priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions