Fixed ACL creation for #504.

This commit is contained in:
Fosco Marotto
2016-02-22 17:33:11 -08:00
parent 1f40c0a7cd
commit 5755126525
3 changed files with 17 additions and 10 deletions

View File

@@ -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();
});
});
});

View File

@@ -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 => {

View File

@@ -262,12 +262,8 @@ function transformACL(restObject) {
wperm.push(entry);
}
}
if (rperm.length) {
output._rperm = rperm;
}
if (wperm.length) {
output._wperm = wperm;
}
output._rperm = rperm;
output._wperm = wperm;
delete restObject.ACL;
return output;
}