Merge branch 'main' into plugin-dependency-install

This commit is contained in:
Will Browne
2025-03-04 10:28:18 +00:00
428 changed files with 18092 additions and 8094 deletions
+4
View File
@@ -71,6 +71,10 @@ func (hs *HTTPServer) declareFixedRoles() error {
Grants: []string{string(org.RoleEditor)},
}
if hs.Cfg.ViewersCanEdit {
datasourcesExplorerRole.Grants = append(datasourcesExplorerRole.Grants, string(org.RoleViewer))
}
datasourcesReaderRole := ac.RoleRegistration{
Role: ac.RoleDTO{
Name: "fixed:datasources:reader",
+11
View File
@@ -99,6 +99,16 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response
return rsp
}
// V2 values should be read from the k8s API
if strings.HasPrefix(dash.APIVersion, "v2") {
root := hs.Cfg.AppSubURL
if !strings.HasSuffix(root, "/") {
root += "/"
}
url := fmt.Sprintf("%sapis/dashboard.grafana.app/%s/namespaces/%s/dashboards/%s", root, dash.APIVersion, hs.namespacer(c.OrgID), dash.UID)
return response.Redirect(url)
}
var (
publicDashboardEnabled = false
err error
@@ -182,6 +192,7 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response
UpdatedBy: updater,
CreatedBy: creator,
Version: dash.Version,
APIVersion: dash.APIVersion,
HasACL: dash.HasACL,
IsFolder: dash.IsFolder,
FolderId: dash.FolderID, // nolint:staticcheck
+1
View File
@@ -26,6 +26,7 @@ type DashboardMeta struct {
Version int `json:"version"`
HasACL bool `json:"hasAcl" xorm:"has_acl"`
IsFolder bool `json:"isFolder"`
APIVersion string `json:"apiVersion,omitempty"` // v0alpha1, v1, v2beta1 etc -- the version things were *saved* at
// Deprecated: use FolderUID instead
FolderId int64 `json:"folderId"`
FolderUid string `json:"folderUid"`
+10
View File
@@ -542,6 +542,16 @@ type AddOrgUserParams struct {
OrgID int64 `json:"org_id"`
}
// swagger:parameters getOrgUsersForCurrentOrg
type GetOrgUsersForCurrentOrgParams struct {
// in:query
// required:false
Query string `json:"query"`
// in:query
// required:false
Limit int `json:"limit"`
}
// swagger:parameters getOrgUsersForCurrentOrgLookup
type LookupOrgUsersParams struct {
// in:query