merge: fixed merge errors
This commit is contained in:
commit
1fcd84367d
2 changed files with 7 additions and 3 deletions
|
@ -34,7 +34,7 @@ export const onlyAllowIfHasAccessToSubmissionFromParams = authorize(async (auth:
|
||||||
const { classId, assignmentId, groupId } = req.query;
|
const { classId, assignmentId, groupId } = req.query;
|
||||||
|
|
||||||
requireFields({ classId, assignmentId, groupId });
|
requireFields({ classId, assignmentId, groupId });
|
||||||
|
|
||||||
if (auth.accountType === AccountType.Teacher) {
|
if (auth.accountType === AccountType.Teacher) {
|
||||||
const cls = await fetchClass(classId as string);
|
const cls = await fetchClass(classId as string);
|
||||||
return cls.teachers.map(mapToUsername).includes(auth.username);
|
return cls.teachers.map(mapToUsername).includes(auth.username);
|
||||||
|
@ -42,4 +42,4 @@ export const onlyAllowIfHasAccessToSubmissionFromParams = authorize(async (auth:
|
||||||
|
|
||||||
const group = await fetchGroup(classId as string, Number(assignmentId as string), Number(groupId as string));
|
const group = await fetchGroup(classId as string, Number(assignmentId as string), Number(groupId as string));
|
||||||
return group.members.map(mapToUsername).includes(auth.username);
|
return group.members.map(mapToUsername).includes(auth.username);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import { createSubmissionHandler, deleteSubmissionHandler, getSubmissionHandler, getSubmissionsHandler } from '../controllers/submissions.js';
|
import { createSubmissionHandler, deleteSubmissionHandler, getSubmissionHandler, getSubmissionsHandler } from '../controllers/submissions.js';
|
||||||
import { onlyAllowIfHasAccessToSubmission, onlyAllowIfHasAccessToSubmissionFromParams, onlyAllowSubmitter } from '../middleware/auth/checks/submission-checks.js';
|
import {
|
||||||
|
onlyAllowIfHasAccessToSubmission,
|
||||||
|
onlyAllowIfHasAccessToSubmissionFromParams,
|
||||||
|
onlyAllowSubmitter,
|
||||||
|
} from '../middleware/auth/checks/submission-checks.js';
|
||||||
import { studentsOnly } from '../middleware/auth/checks/auth-checks.js';
|
import { studentsOnly } from '../middleware/auth/checks/auth-checks.js';
|
||||||
const router = express.Router({ mergeParams: true });
|
const router = express.Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue