Write old ACL format in _acl in addition to new format (#1810)

This commit is contained in:
Tyler Brock
2016-05-16 14:41:25 -07:00
committed by Drew
parent 1854928fe7
commit 3b4ae2d0a0
2 changed files with 26 additions and 1 deletions

View File

@@ -233,6 +233,21 @@ describe('transform schema key changes', () => {
done();
});
it('writes the old ACL format in addition to rperm and wperm', (done) => {
var input = {
ACL: {
"*": { "read": true },
"Kevin": { "write": true }
}
};
var output = transform.parseObjectToMongoObjectForCreate(dummySchema, null, input);
expect(typeof output._acl).toEqual('object');
expect(output._acl["Kevin"].w).toBeTruthy();
expect(output._acl["Kevin"].r).toBeUndefined();
done();
})
it('untransforms from _rperm and _wperm to ACL', (done) => {
var input = {
_rperm: ["*"],