mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: incorrect logic for post history editable bool
This commit is contained in:
@@ -18,8 +18,13 @@ module.exports = function (SocketPosts) {
|
||||
let usernames = await user.getUsersFields(uids, ['username']);
|
||||
usernames = usernames.map(userObj => (userObj.uid ? userObj.username : null));
|
||||
|
||||
const cid = await posts.getCidByPid(data.pid);
|
||||
const canEdit = await privileges.categories.can('posts:edit', cid, socket.uid);
|
||||
let canEdit = true;
|
||||
try {
|
||||
await user.isPrivilegedOrSelf(socket.uid, post.uid);
|
||||
} catch (e) {
|
||||
canEdit = false;
|
||||
}
|
||||
|
||||
timestamps.push(post.timestamp);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user