2019-07-27 00:23:14 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-10-04 00:24:39 +08:00
|
|
|
const queryMayWrite = require('../../utils/query-may-write');
|
2019-07-27 00:23:14 +08:00
|
|
|
|
|
|
|
module.exports = function mayWrite () {
|
|
|
|
return function mayWriteMiddleware (req, res, next) {
|
|
|
|
const { sql } = res.locals.params;
|
|
|
|
res.locals.mayWrite = queryMayWrite(sql);
|
|
|
|
|
|
|
|
next();
|
|
|
|
};
|
|
|
|
};
|