Merge pull request #4809 from FinnStutzenstein/fixRestrictionWithoutRestrictedDataCache
Fix restriction without restricted data cache
This commit is contained in:
commit
585b569bbf
@ -45,7 +45,6 @@ export class RoutingStateService {
|
||||
)
|
||||
.subscribe((event: any[]) => {
|
||||
this._previousUrl = event[0].urlAfterRedirects;
|
||||
console.log('prev URL: ', this._previousUrl);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +396,15 @@ class ElementCache:
|
||||
for collection_string, full_data in changed_elements.items():
|
||||
restricter = self.cachables[collection_string].restrict_elements
|
||||
elements = await restricter(user_id, full_data)
|
||||
restricted_data[collection_string] = elements
|
||||
|
||||
# Add removed objects (through restricter) to deleted elements.
|
||||
full_data_ids = set([data["id"] for data in full_data])
|
||||
restricted_data_ids = set([data["id"] for data in elements])
|
||||
for id in full_data_ids - restricted_data_ids:
|
||||
deleted_elements.append(get_element_id(collection_string, id))
|
||||
|
||||
if elements:
|
||||
restricted_data[collection_string] = elements
|
||||
return restricted_data, deleted_elements
|
||||
|
||||
lowest_change_id = await self.get_lowest_change_id()
|
||||
|
Loading…
Reference in New Issue
Block a user