feat(backend): PUSH, PUT en DELETE endpoints voor leerpaden aangemaakt.
This commit is contained in:
parent
20c04370b5
commit
30ca3b70de
8 changed files with 186 additions and 44 deletions
|
@ -0,0 +1,12 @@
|
|||
import learningPathService from "../../../services/learning-paths/learning-path-service";
|
||||
import { authorize } from "../auth";
|
||||
import { AuthenticatedRequest } from "../authenticated-request";
|
||||
import { AuthenticationInfo } from "../authentication-info";
|
||||
|
||||
export const onlyAdminsForLearningPath = authorize((auth: AuthenticationInfo, req: AuthenticatedRequest) => {
|
||||
const adminsForLearningPath = learningPathService.getAdmins({
|
||||
hruid: req.body.hruid,
|
||||
language: req.body.language
|
||||
});
|
||||
return adminsForLearningPath && auth.username in adminsForLearningPath;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue