This is a script that addresses some feedback from D9599. Ideally, before I put up a diff to attempt to unify `universalCommunityPermissions` and the general thread permission blobs created for `Admins` and `Members` in some way to acheive consistency, it'll be good to run a script against the database contents for roles and permissions to see if there's anything else I'll need to take into consideration. I've already noted that `join_thread` can probably be removed from `universalCommunityPermissions`, but the script should tell me the rest.
The flow of the script is as follows:
1. Fetch roles for community roots and community announcement roots
2. Extract the relevant information for each role
3. Get the expected permissions for the role and the actual/existing permissions for the role
4. Call `deepDiff` two ways on these two permission blobs
5. If there are any disrepencies, attempt to link them back to some user surfaced permissions that could indicate that it's only a result of a user editing a role and not a malformed database
I'm not really sure how this script will behave against a production database, but some thorough testing hasn't led to any glaring issues. I'm expecting a ton of output though that I'll need to sit and parse through.
Depends on D9514
Resolves [[ https://linear.app/comm/issue/ENG-5621/write-a-script-to-compare-database-role-permissions-match-expectations | ENG-5621 ]]