fix: prevent short-circuit on permissions

This commit is contained in:
Paul Makles
2022-07-10 18:27:22 +01:00
parent 0e5c8ed59b
commit 943b1f08f0

View File

@@ -110,7 +110,13 @@ async fn calculate_channel_permission(
// 1. Check channel type.
let value: PermissionValue = match channel {
Channel::SavedMessages { .. } => (*DEFAULT_PERMISSION_SAVED_MESSAGES).into(),
Channel::SavedMessages { user, .. } => {
if user == &data.perspective.id {
(*DEFAULT_PERMISSION_SAVED_MESSAGES).into()
} else {
0_u64.into()
}
}
Channel::DirectMessage { recipients, .. } => {
// 2. Fetch user.
let other_user = recipients