diff --git a/pkg/api/accesscontrol.go b/pkg/api/accesscontrol.go index 8fec8c2d2f7..fba8973eaa3 100644 --- a/pkg/api/accesscontrol.go +++ b/pkg/api/accesscontrol.go @@ -71,6 +71,11 @@ func (hs *HTTPServer) declareFixedRoles() error { Grants: []string{string(org.RoleEditor)}, } + //nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility + if hs.Cfg.ViewersCanEdit { + datasourcesExplorerRole.Grants = append(datasourcesExplorerRole.Grants, string(org.RoleViewer)) + } + datasourcesReaderRole := ac.RoleRegistration{ Role: ac.RoleDTO{ Name: "fixed:datasources:reader",