From 6d853ace9419e9abaa5959f5dba6f51646dea09c Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 7 Dec 2021 16:12:13 +0300 Subject: Add protected locations that are visible only to logged-in users --- src/database/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/database/mod.rs b/src/database/mod.rs index 6a874ed..c0f9f29 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -187,7 +187,9 @@ pub fn filter_post( .unwrap_or(&empty_vec) .iter() .map(|i| i.as_str().unwrap().to_string()); - if location_visibility == "private" && !author.any(|i| Some(i) == *user) { + if (location_visibility == "private" && !author.any(|i| Some(i) == *user)) + || (location_visibility == "protected" && user.is_none()) + { post["properties"] .as_object_mut() .unwrap() -- cgit 1.4.1