grafana/pkg/services/datasources/guardian/allow_guardian.go
Ieva ec9c35fae5
Chore: clean up access control for data sources (#73010)
* move DS guardian interfaces to OSS, move allow guardian to OSS

* update codeowner file
2023-08-21 14:26:49 +01:00

20 lines
563 B
Go

package guardian
import (
"github.com/grafana/grafana/pkg/services/datasources"
)
var _ DatasourceGuardian = new(AllowGuardian)
// AllowGuardian is used whenever an enterprise build is running without a license.
// It allows every one to Query all data sources and will not filter out any of them
type AllowGuardian struct{}
func (n AllowGuardian) CanQuery(datasourceID int64) (bool, error) {
return true, nil
}
func (n AllowGuardian) FilterDatasourcesByQueryPermissions(ds []*datasources.DataSource) ([]*datasources.DataSource, error) {
return ds, nil
}