def METHOD_NAME(team, user):
    """
    Adds a user to a team and assigns them team permissions.
    """
    user.groups.add(team)
    # give the user perms to view the team
    assign_perm("view_team", user, team)
    # if team is owners team assign more perms
    if team.name.find(Team.OWNER_TEAM_NAME) > 0:
        _assign_organization_team_perms(team.organization, user)