mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* adds an api endpoint for use with public dashboards that validates orgId, dashboard, and panel when running a query. This feature is in ALPHA and should not be enabled yet. Testing is based on new mock sqlstore. Co-authored-by: Jesse Weaver <jesse.weaver@grafana.com> Co-authored-by: Leandro Deveikis <leandro.deveikis@gmail.com>
25 lines
584 B
Go
25 lines
584 B
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
"github.com/grafana/grafana/pkg/services/sqlstore"
|
|
)
|
|
|
|
type TeamGuardianStoreImpl struct {
|
|
sqlStore sqlstore.Store
|
|
}
|
|
|
|
func ProvideTeamGuardianStore(sqlStore sqlstore.Store) *TeamGuardianStoreImpl {
|
|
return &TeamGuardianStoreImpl{sqlStore: sqlStore}
|
|
}
|
|
|
|
func (t *TeamGuardianStoreImpl) GetTeamMembers(ctx context.Context, query models.GetTeamMembersQuery) ([]*models.TeamMemberDTO, error) {
|
|
if err := t.sqlStore.GetTeamMembers(ctx, &query); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return query.Result, nil
|
|
}
|