fix: teacher invitations middelware en questions
This commit is contained in:
parent
e799705a09
commit
c054eb9335
4 changed files with 18 additions and 7 deletions
|
@ -15,7 +15,7 @@ import {
|
|||
} from '../controllers/classes.js';
|
||||
import assignmentRouter from './assignments.js';
|
||||
import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js';
|
||||
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks.js';
|
||||
import {onlyAllowIfInClass, onlyAllowIfInClassOrInvited} from '../middleware/auth/checks/class-auth-checks.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
|
@ -23,7 +23,7 @@ router.get('/', adminOnly, getAllClassesHandler);
|
|||
|
||||
router.post('/', teachersOnly, createClassHandler);
|
||||
|
||||
router.get('/:id', onlyAllowIfInClass, getClassHandler);
|
||||
router.get('/:id', onlyAllowIfInClassOrInvited, getClassHandler);
|
||||
|
||||
router.put('/:id', teachersOnly, onlyAllowIfInClass, putClassHandler);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue