11 Commits

Author SHA1 Message Date
a8886ad5ec Annotations: Use dashboard uids instead of dashboard ids (#106676) 2025-06-13 13:59:24 -05:00
fd6a4908f1 Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL. (#101768)
* Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL.
2025-03-10 12:33:52 +01:00
215eb31c7a Annotations: Fix usage of dashboard table for permissions (#98774) 2025-01-10 08:35:38 -06:00
bd1741653d Annotations: Fix composite store read (#94158)
* Annotations: Fix composite store read

* Add test

* check error
2024-10-03 09:14:06 +02:00
5e713673e1 Annotations: Optimize search by tags (#93547)
* Annotations: Optimize search on large number of dashboards

* refactor

* fix batch size

* Return early if no annotations found

* revert go.mod

* return nil in case of error

* Move default limit to the API package

* fix empty access control filter

* Set default limit to 100

* optimize query when number of annotations is less than limit

* Update pkg/services/annotations/annotationsimpl/annotations.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* remove limit from store since it's set in API

* set default limit in Find method (do not break tests)

* Only add limit to the query if it's set

* use limit trick for all searches without dashboard filter

* set default page if not provided

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2024-09-23 17:29:29 +02:00
99d8025829 Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
02606be3ed Access control: Improve annotation delete performance (#85068)
* Access control: Improve annotation delete performance

* simplify query string

* Refactor

* remove unnecessary join
2024-03-26 11:50:51 +01:00
e7a1ecca28 Annotations: Improve query performance when using dashboard filter (#83112)
* Annotations: Improve query performance when using dashboard filter

* Add dashboard id filter
2024-02-21 10:30:26 +01:00
791881f910 RBAC: Change annotation filter to use dashboard based annotation scopes (#78635)
change annotation filter to use dash based annotation scopes
2023-11-29 05:34:44 -05:00
Jo
0de66a8099 Authz: Remove use of SignedInUser copy for permission evaluation (#78448)
* remove use of SignedInUserCopies

* add extra safety to not cross assign permissions

unwind circular dependency

dashboardacl->dashboardaccess

fix missing import

* correctly set teams for permissions

* fix missing inits

* nit: check err

* exit early for api keys
2023-11-22 14:20:22 +01:00
1a53a716e9 Annotations: Lift parts of RBAC from xorm store into auth service (#76967)
* [WIP] Lift RBAC from xorm store

* Cleanup RBAC, fix tests

* Use the scope type map as a map
* Remove dependency on dashboard service
* Make dashboards a map for constant time lookups (useful later)
---
* Lift RBAC tests into a new file to test at service level
* Add necessary access resource structs to xorm store tests

* Move authorization into separate service

* Pass features to searchstore.Builder

* Sort imports

* Code cleanup

* Remove useless scope type check

* Lift permission check into `Authorize()`

* Use clearer language when checking scope types

* Include dashboard permissions in test to ensure they're ignored

* Switch to errutil

* Cleanup sql.Cfg refs
2023-11-14 18:11:01 -05:00