mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
admins can still view all comment streams
This commit is contained in:
@@ -24,8 +24,8 @@ router.get('/', (req, res, next) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only return comment lists for the owner of the comments
|
// if the user is not an admin, only return comment list for the owner of the comments
|
||||||
if (req.user.id !== user_id) {
|
if (req.user.id !== user_id && !authorization.has(req.user, 'admin')) {
|
||||||
next(authorization.ErrNotAuthorized);
|
next(authorization.ErrNotAuthorized);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user