const { allowedOperations } = require('../../../lib/db/project/organisations');

async function operations (req, res, next) {
	if (req.user) {
		req.user.operations = await allowedOperations(req.user?.organisations, req.params.project ?? null);
	}
	next();
}

module.exports = operations;
