Skip to content

Commit

Permalink
result of removeSuperAdmin must retain at least 1 super admin
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed May 28, 2024
1 parent a7cbdce commit d5d06f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/group_permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ impl PolicySet {
// Verify that super admin remove policy was not violated
// You can never remove the last super admin
let super_admin_remove_valid = commit.metadata_changes.super_admins_removed.is_empty()
|| (commit.actor.is_super_admin && commit.metadata_changes.num_super_admins > 1);
|| (commit.actor.is_super_admin && commit.metadata_changes.num_super_admins > 0);

// TODO Validate permissions updates are valid
// once we add the user actions for updating permissions
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/validated_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ fn extract_metadata_changes(
immutable_metadata,
old_mutable_metadata,
),
num_super_admins: old_mutable_metadata.super_admin_list.len() as u32,
num_super_admins: new_mutable_metadata.super_admin_list.len() as u32,
})
}

Expand Down

0 comments on commit d5d06f4

Please sign in to comment.