implemented a way to filter out roles that can't be assigned to permission, and disable permissions that are above the current power level of the user.

This commit is contained in:
Mauro Romito
2025-12-18 18:43:19 +01:00
committed by Mauro
parent e95d0531fb
commit 3626f94289
18 changed files with 197 additions and 90 deletions

View File

@@ -27,7 +27,7 @@ struct RoomRolesAndPermissionsScreen: View {
private var rolesSection: some View {
Section {
if context.viewState.ownRole == .creator {
if context.viewState.ownPowerLevel.role == .creator {
ListRow(label: .default(title: L10n.screenRoomRolesAndPermissionsAdminsAndOwners,
icon: \.admin),
details: administratorOrOwnersDetails,
@@ -53,7 +53,7 @@ struct RoomRolesAndPermissionsScreen: View {
})
.accessibilityIdentifier(A11yIdentifiers.roomRolesAndPermissionsScreen.moderators)
if context.viewState.ownRole != .creator {
if context.viewState.ownPowerLevel.role != .creator {
ListRow(label: .default(title: L10n.screenRoomRolesAndPermissionsChangeMyRole,
icon: \.edit),
kind: .button {