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