Allow create system class even allowClientClassCreation option is false

This commit is contained in:
Marco129
2016-02-27 15:37:34 +08:00
parent db9b72b147
commit c359d0fb5f
3 changed files with 7 additions and 2 deletions

View File

@@ -165,7 +165,9 @@ RestQuery.prototype.redirectClassNameForKey = function() {
// Validates this operation against the allowClientClassCreation config.
RestQuery.prototype.validateClientClassCreation = function() {
if (this.config.allowClientClassCreation === false && !this.auth.isMaster) {
let sysClass = ['_User', '_Installation', '_Role', '_Session', '_Product'];
if (this.config.allowClientClassCreation === false && !this.auth.isMaster
&& sysClass.indexOf(this.className) === -1) {
return this.config.database.loadSchema().then((schema) => {
return schema.hasClass(this.className)
}).then((hasClass) => {