Skip to content

Commit 18d7a7a

Browse files
committed
Merge pull request #586 from ParsePlatform/fosco.emptyACL
Fixed ACL creation for #504.
2 parents 1f40c0a + 5755126 commit 18d7a7a

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

spec/ParseACL.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,4 +1141,18 @@ describe('Parse.ACL', () => {
11411141
}));
11421142
});
11431143

1144+
it('restricted ACL does not have public access', (done) => {
1145+
var obj = new Parse.Object("TestClassMasterACL");
1146+
var acl = new Parse.ACL();
1147+
obj.set('ACL', acl);
1148+
obj.save().then(() => {
1149+
var query = new Parse.Query("TestClassMasterACL");
1150+
return query.find();
1151+
}).then((results) => {
1152+
console.log(JSON.stringify(results[0]));
1153+
ok(!results.length, 'Should not have returned object with secure ACL.');
1154+
done();
1155+
});
1156+
});
1157+
11441158
});

spec/Schema.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ var hasAllPODobject = () => {
1414
obj.set('aArray', ['contents', true, 5]);
1515
obj.set('aGeoPoint', new Parse.GeoPoint({latitude: 0, longitude: 0}));
1616
obj.set('aFile', new Parse.File('f.txt', { base64: 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE=' }));
17-
var objACL = new Parse.ACL();
18-
objACL.setPublicWriteAccess(false);
19-
obj.setACL(objACL);
2017
return obj;
2118
};
2219

@@ -545,7 +542,7 @@ describe('Schema', () => {
545542
done();
546543
Parse.Object.enableSingleInstance();
547544
});
548-
})
545+
});
549546
});
550547

551548
it('can delete pointer fields and resave as string', done => {

src/transform.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,8 @@ function transformACL(restObject) {
262262
wperm.push(entry);
263263
}
264264
}
265-
if (rperm.length) {
266-
output._rperm = rperm;
267-
}
268-
if (wperm.length) {
269-
output._wperm = wperm;
270-
}
265+
output._rperm = rperm;
266+
output._wperm = wperm;
271267
delete restObject.ACL;
272268
return output;
273269
}

0 commit comments

Comments
 (0)