import express from "express";
import { Permission } from "$controllers/index.js";
import { checkPermission } from "$middlewares/index.js";

const router = express.Router();

router.get("/", checkPermission("permissions:view"), Permission.ALL);
router.get("/grouped", checkPermission("permissions:view"), Permission.GROUPED);
router.get("/:id", checkPermission("permissions:view"), Permission.SINGLE);
router.post("/", checkPermission("permissions:create"), Permission.CREATE);
router.put("/:id", checkPermission("permissions:update"), Permission.UPDATE);
router.delete("/:id", checkPermission("permissions:delete"), Permission.DELETE);

export default router;
