feat(mentor-workspace): re-scope files from assignment to project for team-wide visibility

- MentorFile.projectId is the new access boundary; mentorAssignmentId stays
  as informational audit FK (nullable).
- uploadFile derives projectId from the assignment; getFiles takes projectId
  directly; deleteFile/addFileComment auth checks any mentor on the project
  OR a project team member.
- HMAC upload token now binds to projectId (in addition to assignmentId).
- promoteFile reads file.projectId directly (no more mentorAssignment null
  navigation).
- Removes 3 placeholder NOT_FOUND guards added in Task 4.
This commit is contained in:
Matt
2026-05-22 16:53:07 +02:00
parent a5ad11a1b5
commit 3a1eb149b6
9 changed files with 133 additions and 55 deletions

View File

@@ -104,7 +104,10 @@ export default function MentorWorkspaceDetailPage() {
<TabsContent value="files" className="mt-6">
{assignment ? (
<WorkspaceFilesPanel mentorAssignmentId={assignment.id} />
<WorkspaceFilesPanel
projectId={projectId}
mentorAssignmentId={assignment.id}
/>
) : (
<Card>
<CardContent className="text-center py-8">
@@ -117,7 +120,7 @@ export default function MentorWorkspaceDetailPage() {
<TabsContent value="promotion" className="mt-6">
{assignment ? (
<FilePromotionPanel mentorAssignmentId={assignment.id} />
<FilePromotionPanel projectId={projectId} />
) : (
<Card>
<CardContent className="text-center py-8">