Full context is in the comment in comment in [[ https://linear.app/comm/issue/ENG-5622/unify-the-role-creation-and-role-modification-logic#comment-2d98a2cd | ENG-5622 ]], but basically there was not a clear 1:1 match of permissions before and after editing a role sometimes. This is because the user-surfaced permissions provided some `descendant_*` permissions that `Members`, upon creation, did not originally have.
This diff fixes that so there's a clear equality between the two when permissions are edited.
Addresses [[ https://linear.app/comm/issue/ENG-5622/unify-the-role-creation-and-role-modification-logic#comment-2d98a2cd | ENG-5622 ]]
After this, I'll need to update the MariaDB migration in [[ https://phab.comm.dev/D9599 | D9599 ]] and the redux persist migration in [[ https://phab.comm.dev/D9608 | D9608 ]] to remove all of these permissions. That's why I've added them to an array in `lib` called `permissionsToRemoveInMigration` so I can share one common object, rather than copy and pasting the huge collection of strings in both migrations.
Adding @ashoat as a reviewer here since I think he may have the most context on my proposed solution
Depends on D9493