mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Make identity.Requester available at Context * Clean pkg/services/guardian/guardian.go * Clean guardian provider and guardian AC * Clean pkg/api/team.go * Clean ctxhandler, datasources, plugin and live * Clean dashboards and guardian * Implement NewUserDisplayDTOFromRequester * Change status code numbers for http constants * Upgrade signature of ngalert services * log parsing errors instead of throwing error
26 lines
714 B
Go
26 lines
714 B
Go
package guardian
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/services/auth/identity"
|
|
"github.com/grafana/grafana/pkg/services/datasources"
|
|
)
|
|
|
|
type DatasourceGuardianProvider interface {
|
|
New(orgID int64, user identity.Requester, dataSources ...datasources.DataSource) DatasourceGuardian
|
|
}
|
|
|
|
type DatasourceGuardian interface {
|
|
CanQuery(datasourceID int64) (bool, error)
|
|
FilterDatasourcesByQueryPermissions([]*datasources.DataSource) ([]*datasources.DataSource, error)
|
|
}
|
|
|
|
func ProvideGuardian() *OSSProvider {
|
|
return &OSSProvider{}
|
|
}
|
|
|
|
type OSSProvider struct{}
|
|
|
|
func (p *OSSProvider) New(orgID int64, user identity.Requester, dataSources ...datasources.DataSource) DatasourceGuardian {
|
|
return &AllowGuardian{}
|
|
}
|