mirror of
https://github.com/element-hq/element-x-ios.git
synced 2026-01-16 23:01:33 +00:00
better check if an user can edit addresses
This commit is contained in:
parent
45d09b5be5
commit
b1abb729aa
2 changed files with 2 additions and 2 deletions
|
|
@ -145,7 +145,7 @@ class SecurityAndPrivacyScreenViewModel: SecurityAndPrivacyScreenViewModelType,
|
|||
}
|
||||
|
||||
private func setupPermissions(powerLevels: RoomPowerLevelsProxyProtocol) {
|
||||
state.canEditAddress = powerLevels.canOwnUser(sendStateEvent: .roomAliases)
|
||||
state.canEditAddress = powerLevels.canOwnUser(sendStateEvent: .roomCanonicalAlias)
|
||||
state.canEditJoinRule = powerLevels.canOwnUser(sendStateEvent: .roomJoinRules)
|
||||
state.canEditHistoryVisibility = powerLevels.canOwnUser(sendStateEvent: .roomHistoryVisibility)
|
||||
state.canEnableEncryption = powerLevels.canOwnUser(sendStateEvent: .roomEncryption)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ extension RoomPowerLevelsProxyProtocol {
|
|||
func canOwnUserEditSecurityAndPrivacy(isSpace: Bool, joinRule: JoinRule?) -> Bool {
|
||||
let canOwnUserChangeAddress = switch joinRule {
|
||||
case .knockRestricted, .knock, .public:
|
||||
canOwnUser(sendStateEvent: .roomAliases)
|
||||
canOwnUser(sendStateEvent: .roomCanonicalAlias)
|
||||
default:
|
||||
false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue