mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-15 13:41:58 +02:00
privilege fixes
This commit is contained in:
@@ -28,8 +28,8 @@ module.exports = function(Posts) {
|
||||
privileges.posts.canEdit(data.pid, data.uid, next);
|
||||
},
|
||||
function (canEdit, next) {
|
||||
if (!canEdit) {
|
||||
return next(new Error('[[error:no-privileges]]'));
|
||||
if (!canEdit.flag) {
|
||||
return next(new Error(canEdit.message));
|
||||
}
|
||||
Posts.getPostData(data.pid, next);
|
||||
},
|
||||
|
||||
@@ -37,8 +37,8 @@ module.exports = function(Posts) {
|
||||
privileges.posts.canDelete(pid, uid, next);
|
||||
},
|
||||
function (canDelete, next) {
|
||||
if (!canDelete) {
|
||||
return next(new Error('[[error:no-privileges]]'));
|
||||
if (!canDelete.flag) {
|
||||
return next(new Error(canDelete.message));
|
||||
}
|
||||
|
||||
if (isDelete) {
|
||||
|
||||
Reference in New Issue
Block a user