mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: new hook filter:privileges.posts.edit
This commit is contained in:
@@ -264,6 +264,14 @@ module.exports = function (privileges) {
|
||||
edit: async.apply(privileges.posts.can, 'posts:edit', pid, uid),
|
||||
}, next);
|
||||
},
|
||||
(result, next) => {
|
||||
Object.assign(result, {
|
||||
pid: parseInt(pid, 10),
|
||||
uid: uid,
|
||||
});
|
||||
|
||||
plugins.fireHook('filter:privileges.posts.edit', result, next);
|
||||
},
|
||||
function (result, next) {
|
||||
next(null, { flag: result.owner && result.edit, message: '[[error:no-privileges]]' });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user