Summmary:
Was initially planning (and drafting) to encode the BigInt as base64 to be included in stringified JSON. However, as I jotted down (ENG-5373 : Use "bitmask" approach to encoding ThreadPermissions and Role permissions blobs), decided to encode as hex instead.
Update permissionsToBitmask and corresponding hasPermission to return and accept string instead of bigint.