xmtp / libxmtp

MIT License
33 stars 13 forks source link

Creator is only a super admin, not an admin #879

Closed cameronvoell closed 1 day ago

cameronvoell commented 2 days ago

Admin status and Super Admin status of a group are stored as two separate lists of inboxIds in group mutable metadata (MLS Group Context, Unknown Extension).

Previously we were adding a group creator's inbox id to both the Super Admin inboxId list and the Admin inboxId list. This means that if further down the line, if there was another super admin, and they called removeSuperAdmin on the creator inboxID, the creator would still have admin status.

This is a bit confusing and seems unnceccessary, so this PR updates group creation defaults, so that the creator inboxID is only added to the list of SuperAdmin inboxIds. If the at some point in the future their superAdmin status is removed, then they will not have any admin status unless someone specifically calls addAdmin on their inboxId.

**Note, The way permissions are structured, super admins can do everything that admins can do, so this will not affect what permissions group creators will have over their group. It only affects behavior if at some point in the future, the group creator adds another superadmin who then removes the creator's superadmin status.