feat: Allow admins to flag messages in private groups

This commit is contained in:
Blade Barringer
2016-08-24 21:32:32 -05:00
parent 88d26cd200
commit 65556c0444
2 changed files with 41 additions and 2 deletions

View File

@@ -182,7 +182,11 @@ api.flagChat = {
let validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
let group = await Group.getGroup({user, groupId});
let group = await Group.getGroup({
user,
groupId,
optionalMembership: user.contributor.admin,
});
if (!group) throw new NotFound(res.t('groupNotFound'));
let message = _.find(group.chat, {id: req.params.chatId});