You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: utils.go
    path of file: ./repos/grafana/pkg/services/authn/clients
    
    the code of the file until where you have to start completion: package clients

import (
	"github.com/grafana/grafana/pkg/services/org"
	"github.com/grafana/grafana/pkg/setting"
)

// roleExtractor should return the org role, optional isGrafanaAdmin or an error
type roleExtractor func() (org.
    
func getRoles(cfg *setting.Cfg, extract roleExtractor) (map[int64]org.RoleType, *bool, error) {
	role, isGrafanaAdmin, err := extract()
	orgRoles := make(map[int64]org.RoleType, 0)
	if err != nil {
		return orgRoles, nil, err
	}

	if role == "" || !role.IsValid() {
		return orgRoles, nil, nil
	}

	orgID := int64(1)
	if cfg.AutoAssignOrg && cfg.AutoAssignOrgId > 0 {
		orgID = int64(cfg.AutoAssignOrgId)
	}
	orgRoles[orgID] = role

	return orgRoles, isGrafanaAdmin, nil
}