9470e9f
1
2
3
4
5
6
7
8
export const requireAdmin = (req, res, next) => { if (!req.user || req.user.role !== 'admin') { return res.status(403).send({ error: 'Admin only' }); } next(); };