mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: show access denied instead of internal error
when user doesn't have access to chats
This commit is contained in:
@@ -20,7 +20,7 @@ chatsController.get = async function (req, res, next) {
|
|||||||
}
|
}
|
||||||
const canChat = await privileges.global.can('chat', req.uid);
|
const canChat = await privileges.global.can('chat', req.uid);
|
||||||
if (!canChat) {
|
if (!canChat) {
|
||||||
return next(new Error('[[error:no-privileges]]'));
|
return helpers.notAllowed(req, res, '[[error:no-privileges]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
|
|||||||
Reference in New Issue
Block a user