mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Identity: Port snapshots and annotations to Requester (#76103)
* Port snapshots to Requester * Port annotations to Requester
This commit is contained in:
@@ -12,13 +12,13 @@ import (
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/annotations"
|
||||
"github.com/grafana/grafana/pkg/services/auth/identity"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/permissions"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/searchstore"
|
||||
"github.com/grafana/grafana/pkg/services/tag"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@@ -378,14 +378,15 @@ type acFilter struct {
|
||||
recParams []interface{}
|
||||
}
|
||||
|
||||
func (r *xormRepositoryImpl) getAccessControlFilter(user *user.SignedInUser) (acFilter, error) {
|
||||
func (r *xormRepositoryImpl) getAccessControlFilter(user identity.Requester) (acFilter, error) {
|
||||
var recQueries string
|
||||
var recQueriesParams []interface{}
|
||||
|
||||
if user == nil || user.Permissions[user.OrgID] == nil {
|
||||
if user == nil || user.IsNil() {
|
||||
return acFilter{}, errors.New("missing permissions")
|
||||
}
|
||||
scopes, has := user.Permissions[user.OrgID][ac.ActionAnnotationsRead]
|
||||
|
||||
scopes, has := user.GetPermissions()[ac.ActionAnnotationsRead]
|
||||
if !has {
|
||||
return acFilter{}, errors.New("missing permissions")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user