Merge pull request #515 from flovilmart/receipt-validation

Adds receipt validation endpoint
This commit is contained in:
Nikita Lutsenko
2016-02-19 17:41:16 -08:00
6 changed files with 363 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ RestWrite.prototype.getUserAndRoleACL = function() {
// Validates this operation against the schema.
RestWrite.prototype.validateSchema = function() {
return this.config.database.validateObject(this.className, this.data);
return this.config.database.validateObject(this.className, this.data, this.query);
};
// Runs any beforeSave triggers against this operation.
@@ -705,6 +705,10 @@ RestWrite.prototype.runDatabaseOperation = function() {
throw new Parse.Error(Parse.Error.SESSION_MISSING,
'cannot modify user ' + this.query.objectId);
}
if (this.className === '_Product' && this.data.download) {
this.data.downloadName = this.data.download.name;
}
// TODO: Add better detection for ACL, ensuring a user can't be locked from
// their own user record.