feat: new hook filter:privileges.posts.edit

This commit is contained in:
Julian Lam
2019-01-26 13:48:37 -05:00
parent df6f75eb05
commit f659ef4d80

View File

@@ -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]]' });
},