How to use the simpl-schema.denyUntrusted function in simpl-schema

To help you get started, we’ve selected a few simpl-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github copleykj / socialize-messaging / conversation-model / common / conversation-model.js View on Github external
},
            index: -1,
            denyUpdate: true,
        },
        updatedAt: {
            type: Date,
            optional: true,
            autoValue() {
                return ServerTime.date();
            },
            index: -1,
        },
        messageCount: {
            type: Number,
            defaultValue: 0,
            custom: SimpleSchema.denyUntrusted,
        },
        _participants: {
            type: Array,
            defaultValue: [],
            index: 1,
        },
        '_participants.$': {
            type: String,
            regEx: SimpleSchema.RegEx.Id,
        },
    }));

    return Conversation;
};
github copleykj / socialize-base-model / base-model.js View on Github external
getUpdatableFields() {
            const schema = this._getSchema()._schema;
            const fields = { _id: this._id };

            for (const key of Object.keys(this)) {
                if (schema[key] && !(schema[key].custom && schema[key].custom === SimpleSchema.denyUntrusted) && !schema[key].denyUpdate) {
                    fields[key] = this[key];
                }
            }

            return fields;
        }