mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Unified Storage: Permissions can filter search results (#99042)
* fix bug when parsing results in search handler * applies permissions filtering to bleve query * formatting * wraps in check for access being present, adds some comments * update go mod * fix tests * add dep owner * fix go mod * add space after // * clean up returns Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com> * fixed formatting * Uses single checker since index is for single resource. Passes folderId using dvReader to checker func. Adds debug logging. * handles federation with index permission checkers * formatting * move import --------- Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>
This commit is contained in:
@@ -1843,6 +1843,10 @@ func TestParseResults(t *testing.T) {
|
||||
TotalHits: 1,
|
||||
}
|
||||
|
||||
_, err := ParseResults(resSearchResp, 0)
|
||||
res, err := ParseResults(resSearchResp, 0)
|
||||
|
||||
require.NoError(t, err)
|
||||
hitFields := res.Hits[0].Field.Object
|
||||
require.Equal(t, int64(100), hitFields[search.DASHBOARD_ERRORS_LAST_1_DAYS])
|
||||
require.Equal(t, int64(25), hitFields[search.DASHBOARD_LINK_COUNT])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user