fix: filter private views based on parent space (#860)
This commit is contained in:
parent
2f47d07593
commit
ec2cc309bd
|
|
@ -13,13 +13,16 @@ pub fn collab_folder_to_folder_view(
|
||||||
pubished_view_ids: &HashSet<String>,
|
pubished_view_ids: &HashSet<String>,
|
||||||
) -> Result<FolderView, AppError> {
|
) -> Result<FolderView, AppError> {
|
||||||
let mut unviewable = HashSet::new();
|
let mut unviewable = HashSet::new();
|
||||||
for private_section in folder.get_all_private_sections() {
|
let mut my_private_view_ids = HashSet::new();
|
||||||
unviewable.insert(private_section.id);
|
|
||||||
}
|
|
||||||
let mut private_view_ids = HashSet::new();
|
|
||||||
for private_section in folder.get_my_private_sections() {
|
for private_section in folder.get_my_private_sections() {
|
||||||
unviewable.remove(&private_section.id);
|
my_private_view_ids.insert(private_section.id);
|
||||||
private_view_ids.insert(private_section.id);
|
}
|
||||||
|
for private_section in folder.get_all_private_sections() {
|
||||||
|
if let Some(private_view) = folder.get_view(&private_section.id) {
|
||||||
|
if view_is_space(&private_view) && !my_private_view_ids.contains(&private_section.id) {
|
||||||
|
unviewable.insert(private_section.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for trash_view in folder.get_all_trash_sections() {
|
for trash_view in folder.get_all_trash_sections() {
|
||||||
unviewable.insert(trash_view.id);
|
unviewable.insert(trash_view.id);
|
||||||
|
|
@ -30,7 +33,7 @@ pub fn collab_folder_to_folder_view(
|
||||||
root_view_id,
|
root_view_id,
|
||||||
folder,
|
folder,
|
||||||
&unviewable,
|
&unviewable,
|
||||||
&private_view_ids,
|
&my_private_view_ids,
|
||||||
pubished_view_ids,
|
pubished_view_ids,
|
||||||
false,
|
false,
|
||||||
0,
|
0,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue