[lib] Extract userSurfacedPermissionsFromRolePermissions
Summary:
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
Test Plan: This is a simple move diff. Besides Flow, it was also tested in combination with subsequent diffs
Reviewers: tomek, inka
Reviewed By: tomek
Differential Revision: https://phab.comm.dev/D13073