mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
feat: stub code for v3 chats api
This commit is contained in:
@@ -133,6 +133,14 @@ module.exports = function (middleware) {
|
||||
controllers.helpers.notAllowed(req, res);
|
||||
});
|
||||
|
||||
middleware.canChat = helpers.try(async (req, res, next) => {
|
||||
const canChat = await privileges.global.can('chat', req.uid);
|
||||
if (canChat) {
|
||||
return next();
|
||||
}
|
||||
controllers.helpers.notAllowed(req, res);
|
||||
});
|
||||
|
||||
middleware.checkAccountPermissions = helpers.try(async (req, res, next) => {
|
||||
// This middleware ensures that only the requested user and admins can pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user