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

const router = express.Router();

router.get("/", checkPermission("roles:view"), Role.ALL);
router.post("/", checkPermission("roles:create"), Role.CREATE);
router.get("/:id", checkPermission("roles:view"), Role.SINGLE);
router.put("/:id", checkPermission("roles:update"), Role.UPDATE);
router.delete("/:id", checkPermission("roles:delete"), Role.DELETE);
router.put(
  "/update/priority",
  checkPermission("roles:update"),
  Role.UPDATE_PRIORITY,
);

export default router;
