mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 11:01:20 +01:00
fix: send guests to login page if they access uncategorized topics without local posts
This commit is contained in:
@@ -53,12 +53,16 @@ topicsController.get = async function getTopic(req, res, next) {
|
|||||||
if (
|
if (
|
||||||
userPrivileges.disabled ||
|
userPrivileges.disabled ||
|
||||||
invalidPagination ||
|
invalidPagination ||
|
||||||
(topicData.scheduled && !userPrivileges.view_scheduled) ||
|
(topicData.scheduled && !userPrivileges.view_scheduled)
|
||||||
await shouldHideTopicFromGuest(req.uid, tid, topicData.cid)) {
|
) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userPrivileges['topics:read'] || (!topicData.scheduled && topicData.deleted && !userPrivileges.view_deleted)) {
|
if (
|
||||||
|
!userPrivileges['topics:read'] ||
|
||||||
|
(!topicData.scheduled && topicData.deleted && !userPrivileges.view_deleted) ||
|
||||||
|
await shouldHideTopicFromGuest(req.uid, tid, topicData.cid)
|
||||||
|
) {
|
||||||
return helpers.notAllowed(req, res);
|
return helpers.notAllowed(req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user