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:
owensmallwood
2025-01-20 14:30:09 -06:00
committed by GitHub
parent 9801a5a943
commit c45aff1251
4 changed files with 246 additions and 44 deletions

View File

@@ -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])
}