permissions
This commit is contained in:
parent
624408c973
commit
a112805fbb
1 changed files with 71 additions and 30 deletions
|
@ -19,6 +19,7 @@ import {
|
|||
synchronizeProtocolPrecenseById,
|
||||
synchronizeProtocolVotingsById,
|
||||
} from "../../controller/admin/protocolController";
|
||||
import PermissionHelper from "../../helpers/permissionHelper";
|
||||
|
||||
var router = express.Router({ mergeParams: true });
|
||||
|
||||
|
@ -54,44 +55,84 @@ router.get("/:protocolId/printout/:printoutId", async (req: Request, res: Respon
|
|||
await getProtocolPrintoutByIdAndPrint(req, res);
|
||||
});
|
||||
|
||||
router.post("/", async (req: Request, res: Response) => {
|
||||
router.post(
|
||||
"/",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocol(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.post("/:protocolId/agenda", async (req: Request, res: Response) => {
|
||||
router.post(
|
||||
"/:protocolId/agenda",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolAgendaById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.post("/:protocolId/decision", async (req: Request, res: Response) => {
|
||||
router.post(
|
||||
"/:protocolId/decision",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolDecisonsById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.post("/:protocolId/voting", async (req: Request, res: Response) => {
|
||||
router.post(
|
||||
"/:protocolId/voting",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolVotingsById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.post("/:protocolId/printout", async (req: Request, res: Response) => {
|
||||
router.post(
|
||||
"/:protocolId/printout",
|
||||
PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await createProtocolPrintoutById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.patch("/:id/synchronize", async (req: Request, res: Response) => {
|
||||
router.patch(
|
||||
"/:id/synchronize",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.patch("/:protocolId/synchronize/agenda", async (req: Request, res: Response) => {
|
||||
router.patch(
|
||||
"/:protocolId/synchronize/agenda",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolAgendaById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.patch("/:protocolId/synchronize/decisions", async (req: Request, res: Response) => {
|
||||
router.patch(
|
||||
"/:protocolId/synchronize/decisions",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolDecisonsById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.patch("/:protocolId/synchronize/votings", async (req: Request, res: Response) => {
|
||||
router.patch(
|
||||
"/:protocolId/synchronize/votings",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolVotingsById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
router.put("/:protocolId/synchronize/presence", async (req: Request, res: Response) => {
|
||||
router.put(
|
||||
"/:protocolId/synchronize/presence",
|
||||
PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
|
||||
async (req: Request, res: Response) => {
|
||||
await synchronizeProtocolPrecenseById(req, res);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
export default router;
|
||||
|
|
Loading…
Reference in a new issue