Skip to content

Fixed ACL creation for #504. #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions spec/ParseACL.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

});
5 changes: 1 addition & 4 deletions spec/Schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -545,7 +542,7 @@ describe('Schema', () => {
done();
Parse.Object.enableSingleInstance();
});
})
});
});

it('can delete pointer fields and resave as string', done => {
Expand Down
8 changes: 2 additions & 6 deletions src/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down