Commit 2d4148fb authored by Jean-Philippe Steinmetz's avatar Jean-Philippe Steinmetz
Browse files

Fixing bug that caused ACL parents to not be populated when pulling from cache

parent 10707f6b
......@@ -261,9 +261,6 @@ class ACLUtils {
if (json) {
try {
acl = JSON.parse(json);
if (acl) {
await this.populateParent(acl);
}
} catch (err) {
// We don't care if this fails
}
......@@ -280,19 +277,19 @@ class ACLUtils {
acl = acl ? new AccessControlListSQL(acl) : undefined;
}
// Retrieve the parent ACL and assign it if available. Don't populate parents we've
// already found to prevent a circular dependency.
if (acl && acl.parentUid && !parentUids.includes(acl.parentUid)) {
parentUids.push(acl.parentUid);
acl.parent = await this.findACL(acl.parentUid, parentUids);
}
// Store a copy in the cache for faster retrieval next time
if (this.cacheClient) {
await this.cacheClient.setex(`${CACHE_BASE_KEY}.${entityId}`, this.cacheTTL, JSON.stringify(acl));
}
}
// Retrieve the parent ACL and assign it if available. Don't populate parents we've
// already found to prevent a circular dependency.
if (acl && acl.parentUid && !parentUids.includes(acl.parentUid)) {
parentUids.push(acl.parentUid);
acl.parent = await this.findACL(acl.parentUid, parentUids);
}
return acl;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment