From 5d169d477a4caecf83881c2ee8e110531574bb44 Mon Sep 17 00:00:00 2001 From: Scott <31902527+Scottd125@users.noreply.github.com> Date: Mon, 10 Aug 2020 18:38:56 +0200 Subject: [PATCH] Added bannedWordsAllowed attribute to Group attributes (Partial fix for #12405) (#12440) * Added bannedWordsAllowed attribute to Group attributes Added an optional Boolean attribute which will determine if banned words are allowed * Added bannedWordsAllowed attribute to non-settable fields --- website/server/models/group.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/server/models/group.js b/website/server/models/group.js index 8223df0743..7d764c1fdb 100644 --- a/website/server/models/group.js +++ b/website/server/models/group.js @@ -85,6 +85,7 @@ export const schema = new Schema({ $type: String, enum: ['private', 'public'], default: 'private', required: true, }, chat: Array, // Used for backward compatibility, but messages aren't stored here + bannedWordsAllowed: { $type: Boolean, required: false }, leaderOnly: { // restrict group actions to leader (members can't do them) challenges: { $type: Boolean, default: false, required: true }, // invites: {$type: Boolean, default: false, required: true}, @@ -150,7 +151,7 @@ export const schema = new Schema({ }); schema.plugin(baseModel, { - noSet: ['_id', 'balance', 'quest', 'memberCount', 'chat', 'challengeCount', 'tasksOrder', 'purchased', 'managers'], + noSet: ['_id', 'balance', 'quest', 'memberCount', 'chat', 'bannedWordsAllowed', 'challengeCount', 'tasksOrder', 'purchased', 'managers'], private: ['purchased.plan'], toJSONTransform (plainObj, originalDoc) { if (plainObj.purchased) plainObj.purchased.active = originalDoc.hasActiveGroupPlan();