Skip to content

Commit 54baa5c

Browse files
authored
fix(Role): stop complaint about defaultACL when query Roles (#484)
1 parent 66cabe8 commit 54baa5c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/query.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,13 @@ module.exports = function(AV) {
241241
},
242242

243243
_newObject: function(response){
244-
var obj;
245244
if (response && response.className) {
246-
obj = new AV.Object(response.className);
247-
} else {
248-
obj = new this.objectClass();
245+
return new AV.Object(response.className);
249246
}
250-
return obj;
247+
if (this.objectClass === AV.Role) {
248+
return new AV.Role(undefined, undefined, /* noDefaultACL */ true);
249+
}
250+
return new this.objectClass();
251251
},
252252
_createRequest(params = this.toJSON(), options) {
253253
if (JSON.stringify(params).length > 2000) {

0 commit comments

Comments
 (0)