fix(issues): only allow edit of own comments & do not allow non-admin delete of issues with comments (#2248)

This commit is contained in:
TheCatLady
2021-10-30 19:54:01 -04:00
committed by GitHub
parent 0828b008ba
commit bba09d69c1
5 changed files with 63 additions and 59 deletions

View File

@@ -302,7 +302,7 @@ issueRoutes.delete('/:issueId', async (req, res, next) => {
if (
!req.user?.hasPermission(Permission.MANAGE_ISSUES) &&
issue.createdBy.id !== req.user?.id
(issue.createdBy.id !== req.user?.id || issue.comments.length > 1)
) {
return next({
status: 401,