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[]) => {
|
.subscribe((event: any[]) => {
|
||||||
this._previousUrl = event[0].urlAfterRedirects;
|
this._previousUrl = event[0].urlAfterRedirects;
|
||||||
console.log('prev URL: ', this._previousUrl);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,6 +396,14 @@ class ElementCache:
|
|||||||
for collection_string, full_data in changed_elements.items():
|
for collection_string, full_data in changed_elements.items():
|
||||||
restricter = self.cachables[collection_string].restrict_elements
|
restricter = self.cachables[collection_string].restrict_elements
|
||||||
elements = await restricter(user_id, full_data)
|
elements = await restricter(user_id, full_data)
|
||||||
|
|
||||||
|
# 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
|
restricted_data[collection_string] = elements
|
||||||
return restricted_data, deleted_elements
|
return restricted_data, deleted_elements
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user