Merge pull request #438 from flovilmart/flovilmart.fix-default_User.metadata
Adds locked down ACL on _User
This commit is contained in:
@@ -655,6 +655,13 @@ RestWrite.prototype.runDatabaseOperation = function() {
|
||||
this.response.updatedAt = this.updatedAt;
|
||||
});
|
||||
} else {
|
||||
// Set the default ACL for the new _User
|
||||
if (!this.data.ACL && this.className === '_User') {
|
||||
var ACL = {};
|
||||
ACL[this.data.objectId] = { read: true, write: true };
|
||||
ACL['*'] = { read: true, write: false };
|
||||
this.data.ACL = ACL;
|
||||
}
|
||||
// Run a create
|
||||
return this.config.database.create(this.className, this.data, options)
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user