(cherry picked from commit 592d31e617)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
co-authored by
Karl Persson
parent
712b474226
commit
806b7405aa
@@ -130,6 +130,10 @@ func NewDashboardUIDScopeResolver(db Store) (string, ac.ScopeAttributeResolver)
|
||||
|
||||
func resolveDashboardScope(ctx context.Context, db Store, orgID int64, dashboard *models.Dashboard) ([]string, error) {
|
||||
var folderUID string
|
||||
if dashboard.FolderId < 0 {
|
||||
return []string{ScopeDashboardsProvider.GetResourceScopeUID(dashboard.Uid)}, nil
|
||||
}
|
||||
|
||||
if dashboard.FolderId == 0 {
|
||||
folderUID = ac.GeneralFolderUID
|
||||
} else {
|
||||
@@ -139,6 +143,7 @@ func resolveDashboardScope(ctx context.Context, db Store, orgID int64, dashboard
|
||||
}
|
||||
folderUID = folder.Uid
|
||||
}
|
||||
|
||||
return []string{
|
||||
ScopeDashboardsProvider.GetResourceScopeUID(dashboard.Uid),
|
||||
ScopeFoldersProvider.GetResourceScopeUID(folderUID),
|
||||
|
||||
Reference in New Issue
Block a user