RBAC: Add scope resolvers for dashboards (#50110)
* Inject access control into dashboard service * Add function to parse id scopes * Add dashboard as return value * Update mock * Return only err to keep service interface * Add scope resolvers for dashboard id scopes * Add function to parse uid scopes * Add dashboard uid scope resolver * Register scope resolvers for dashboards Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
co-authored by
Gabriel MABILLE
parent
9f6afb3475
commit
c4a75f9eb3
@@ -62,7 +62,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
_, err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, query.Result.Title, "test dash 23")
|
||||
@@ -79,7 +79,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
_, err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, query.Result.Title, "test dash 23")
|
||||
@@ -96,7 +96,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
_, err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, query.Result.Title, "test dash 23")
|
||||
@@ -120,7 +120,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
_, err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.Equal(t, err, models.ErrDashboardIdentifierNotSet)
|
||||
})
|
||||
|
||||
@@ -202,7 +202,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err = dashboardStore.GetDashboard(context.Background(), &query)
|
||||
_, err = dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, query.Result.FolderId, int64(0))
|
||||
require.Equal(t, query.Result.CreatedBy, savedDash.CreatedBy)
|
||||
|
||||
Reference in New Issue
Block a user