I see that api create a team has the units_map. I think that is more flexible than using permission with units. We can assign repo unit with different permission.
"units_map": { "repo.code": "read", "repo.ext_issues": "none", "repo.ext_wiki": "none", "repo.issues": "write", "repo.projects": "none", "repo.pulls": "owner", "repo.releases": "none", "repo.wiki": "admin" }