Files
grafana/pkg/registry/apis/iam/legacy/service_account_internal_id.sql
Karl Persson 0160f4f72c RBAC: Add legacy authorization checks to service accounts (#93753)
* Extract a helper funtion to perform list with authorization checks

* Add k8s verb to utils package

* Construct default mapping when no custom mapping is passed

* Configure authorization checks for service accounts

* Fix helper and add filtering to service accounts
2024-09-27 15:53:11 +02:00

8 lines
218 B
SQL

SELECT u.id
FROM {{ .Ident .UserTable }} as u
INNER JOIN {{ .Ident .OrgUserTable }} as o ON u.id = o.user_id
WHERE o.org_id = {{ .Arg .Query.OrgID }}
AND u.uid = {{ .Arg .Query.UID }}
AND u.is_service_account
LIMIT 1;