Allow workspace admins to remove comments (#5270)

This commit is contained in:
Tom Moor
2023-04-27 21:34:01 -04:00
committed by GitHub
parent ef075c0fa2
commit 4dade03c33
2 changed files with 6 additions and 4 deletions

View File

@@ -12,5 +12,9 @@ allow(User, ["read", "update", "delete"], Comment, (user, comment) => {
if (!comment) {
return false;
}
return user?.id === comment.createdById;
if (user.teamId !== comment.createdBy.teamId) {
return false;
}
return user.isAdmin || user?.id === comment.createdById;
});