helpyourneighbour/backend/routes/offers.js
BibaBot Jarvis 753b54e0e1
Some checks are pending
Docker Test / test (push) Waiting to run
feat: implement role-based access control and auth routes
This commit implements the role-based access control middleware and adds auth routes with proper role checks for user, moderator, and admin roles as defined in the documentation.
2026-03-15 22:06:51 +00:00

21 lines
No EOL
658 B
JavaScript

// routes/offers.js
const express = require('express');
const router = express.Router();
const requireRole = require('../middleware/requireRole');
// Protected route - create offer
router.post('/', requireRole(['user', 'moderator', 'admin']), (req, res) => {
// Implementation for creating an offer
});
// Protected route - get offers
router.get('/', requireRole(['user', 'moderator', 'admin']), (req, res) => {
// Implementation for getting offers
});
// Protected route - get specific offer
router.get('/:id', requireRole(['user', 'moderator', 'admin']), (req, res) => {
// Implementation for getting a specific offer
});
module.exports = router;