This diff extracts a function from useRoleUserSurfacedPermissions, which I'm naming userSurfacedPermissionsFromRolePermissions.
We want to use this extracted function to address ENG-9031. It will be called by the keyserver from updateRoles to determine the currently-selected set of user-surfaced permissions.
Depends on D13068