Makes sure we don't duplicate user ACL's keys (#2651)

* Adds repro for issue #2246

* Provide fix for issue #2246

* Nit with Set to deduplicate the acl array

* remove debuging console.log
This commit is contained in:
Florent Vilmart
2016-09-09 14:43:59 -04:00
committed by GitHub
parent e8aa1ad312
commit c5fdd91aa3
3 changed files with 40 additions and 2 deletions

View File

@@ -859,6 +859,7 @@ DatabaseController.prototype.addPointerPermissions = function(schema, className,
// the ACL should have exactly 1 user
if (perms && perms[field] && perms[field].length > 0) {
// No user set return undefined
// If the length is > 1, that means we didn't dedup users correctly
if (userACL.length != 1) {
return;
}