fix(spaces): don't reset manual PL overrides in sync_power_levels
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4s
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4s
Remove the else branch that stripped power levels from users not managed by any space role. This was destroying manually-set PLs for users who happened to be in space-managed rooms but had no space roles. Space roles should only SET power levels for managed users, never remove entries for non-managed users.
This commit is contained in:
parent
528c1c501e
commit
5787f38906
1 changed files with 0 additions and 17 deletions
|
|
@ -579,23 +579,6 @@ pub async fn sync_power_levels(&self, space_id: &RoomId, room_id: &RoomId) -> Re
|
|||
.insert(user_id.clone(), space_pl_int);
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
let parents = self.get_parent_spaces(room_id).await;
|
||||
let mut managed_by_other = false;
|
||||
for parent in &parents {
|
||||
if self.get_user_power_level(parent, user_id).await.is_some() {
|
||||
managed_by_other = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !managed_by_other {
|
||||
if let Some(current) = power_levels_content.users.get(user_id) {
|
||||
if *current != power_levels_content.users_default {
|
||||
power_levels_content.users.remove(user_id);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue