mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: dont show deleted posts in navigator
This commit is contained in:
@@ -86,12 +86,13 @@ SocketPosts.getPostSummaryByIndex = async function (socket, data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const canRead = await privileges.posts.can('topics:read', pid, socket.uid);
|
||||
if (!canRead) {
|
||||
const topicPrivileges = await privileges.topics.get(data.tid, socket.uid);
|
||||
if (!topicPrivileges['topics:read']) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
}
|
||||
|
||||
const postsData = await posts.getPostSummaryByPids([pid], socket.uid, { stripTags: false });
|
||||
posts.modifyPostByPrivilege(postsData[0], topicPrivileges);
|
||||
return postsData[0];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user