Inverse of grantPermissions: flatten grouped permissions back into
the string[] form a grant is signed with.
Output is canonical (scopes in code-unit order, read before write, no
duplicates), so permissionsToScopes(grantPermissions(scopes)) is the
canonical form of scopes, and grantPermissions(permissionsToScopes(p))
is the canonical form of p. Rows with no actions contribute nothing; a
row with an action the grammar does not define throws rather than being
dropped.
Inverse of grantPermissions: flatten grouped permissions back into the
string[]form a grant is signed with.Output is canonical (scopes in code-unit order, read before write, no duplicates), so
permissionsToScopes(grantPermissions(scopes))is the canonical form ofscopes, andgrantPermissions(permissionsToScopes(p))is the canonical form ofp. Rows with no actions contribute nothing; a row with an action the grammar does not define throws rather than being dropped.