AuthZ: Deleting managed role permissions for a specified resource (#110617)

* basics for deleting managed role permissions for a specified resource

* fix the query

* fix query tests

* storage tests

* sql tests

* add missing import

* Update pkg/registry/apis/iam/resourcepermission/storage_backend.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* PR feedback

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
Ieva
2025-09-05 16:22:09 +01:00
committed by GitHub
co-authored by Gabriel MABILLE
parent ba202ebab1
commit d692303e76
11 changed files with 291 additions and 12 deletions
@@ -0,0 +1,8 @@
DELETE FROM `grafana`.`permission` as p
WHERE p.scope = 'dash_123'
AND p.role_id IN (
SELECT r.id
FROM `grafana`.`role` as r
WHERE r.name LIKE 'managed:%'
AND r.org_id = 3
)
@@ -0,0 +1,8 @@
DELETE FROM "grafana"."permission" as p
WHERE p.scope = 'dash_123'
AND p.role_id IN (
SELECT r.id
FROM "grafana"."role" as r
WHERE r.name LIKE 'managed:%'
AND r.org_id = 3
)
@@ -0,0 +1,8 @@
DELETE FROM "grafana"."permission" as p
WHERE p.scope = 'dash_123'
AND p.role_id IN (
SELECT r.id
FROM "grafana"."role" as r
WHERE r.name LIKE 'managed:%'
AND r.org_id = 3
)