Server: sensitive flag takes precedence over ownership

This commit is contained in:
asonix 2021-02-03 21:47:12 -06:00
parent 2cce47af4b
commit 1f6c5d4076

View file

@ -315,14 +315,14 @@ pub(crate) fn can_view(
can_view_sensitive: bool,
) -> Option<()> {
if let Some(viewer) = viewer {
if viewer == submission.profile_id() {
return Some(());
}
if submission.is_sensitive() && !can_view_sensitive {
return None;
}
if viewer == submission.profile_id() {
return Some(());
}
if let Some(block) = cache.blocks.get(&submission.profile_id()) {
if *block {
return None;