Cfg: Deduplicate DefaultOrgID code (#93588)
Cfg: Expose DefaultOrgID function
This commit is contained in:
@@ -4,21 +4,12 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
const (
|
||||
ServiceAccounts AuthProvider = "ServiceAccounts"
|
||||
)
|
||||
|
||||
func DefaultOrgID(cfg *setting.Cfg) int64 {
|
||||
orgID := int64(1)
|
||||
if cfg.AutoAssignOrg && cfg.AutoAssignOrgId > 0 {
|
||||
orgID = int64(cfg.AutoAssignOrgId)
|
||||
}
|
||||
return orgID
|
||||
}
|
||||
|
||||
type AuthProvider string
|
||||
|
||||
//go:generate mockery --name ExternalServiceRegistry --structname ExternalServiceRegistryMock --output tests --outpkg tests --filename extsvcregmock.go
|
||||
|
||||
Reference in New Issue
Block a user