feat: implement role-based access control and auth routes
Some checks are pending
Docker Test / test (push) Waiting to run

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.
This commit is contained in:
BibaBot Jarvis 2026-03-15 22:06:51 +00:00
parent 37df062f3b
commit 753b54e0e1
5 changed files with 89 additions and 109 deletions

21
backend/routes/offers.js Normal file
View file

@ -0,0 +1,21 @@
// 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;