mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
LibraryPanels: Adds permissions to getAllHandler (#31416)
* LibraryPanels: Adds permissions to getAllHandler * Chore: adds a test to verify the permissions * Chore: tests refactor
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
func TestSQLBuilder(t *testing.T) {
|
||||
t.Run("writeDashboardPermissionFilter", func(t *testing.T) {
|
||||
t.Run("WriteDashboardPermissionFilter", func(t *testing.T) {
|
||||
t.Run("user ACL", func(t *testing.T) {
|
||||
test(t,
|
||||
DashboardProps{},
|
||||
@@ -340,7 +340,7 @@ func getDashboards(sqlStore *SQLStore, search Search, aclUserId int64) ([]*dashb
|
||||
|
||||
var res []*dashboardResponse
|
||||
builder.Write("SELECT * FROM dashboard WHERE true")
|
||||
builder.writeDashboardPermissionFilter(signedInUser, search.RequiredPermission)
|
||||
builder.WriteDashboardPermissionFilter(signedInUser, search.RequiredPermission)
|
||||
err := sqlStore.engine.SQL(builder.GetSQLString(), builder.params...).Find(&res)
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user