Fixed ACL creation for #504.
This commit is contained in:
@@ -1141,4 +1141,18 @@ describe('Parse.ACL', () => {
|
||||
}));
|
||||
});
|
||||
|
||||
it('restricted ACL does not have public access', (done) => {
|
||||
var obj = new Parse.Object("TestClassMasterACL");
|
||||
var acl = new Parse.ACL();
|
||||
obj.set('ACL', acl);
|
||||
obj.save().then(() => {
|
||||
var query = new Parse.Query("TestClassMasterACL");
|
||||
return query.find();
|
||||
}).then((results) => {
|
||||
console.log(JSON.stringify(results[0]));
|
||||
ok(!results.length, 'Should not have returned object with secure ACL.');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -14,9 +14,6 @@ var hasAllPODobject = () => {
|
||||
obj.set('aArray', ['contents', true, 5]);
|
||||
obj.set('aGeoPoint', new Parse.GeoPoint({latitude: 0, longitude: 0}));
|
||||
obj.set('aFile', new Parse.File('f.txt', { base64: 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE=' }));
|
||||
var objACL = new Parse.ACL();
|
||||
objACL.setPublicWriteAccess(false);
|
||||
obj.setACL(objACL);
|
||||
return obj;
|
||||
};
|
||||
|
||||
@@ -545,7 +542,7 @@ describe('Schema', () => {
|
||||
done();
|
||||
Parse.Object.enableSingleInstance();
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('can delete pointer fields and resave as string', done => {
|
||||
|
||||
@@ -262,12 +262,8 @@ function transformACL(restObject) {
|
||||
wperm.push(entry);
|
||||
}
|
||||
}
|
||||
if (rperm.length) {
|
||||
output._rperm = rperm;
|
||||
}
|
||||
if (wperm.length) {
|
||||
output._wperm = wperm;
|
||||
}
|
||||
delete restObject.ACL;
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user