grafana-iam: Implement resourcepermission update (#110891)

* first go at update implementation

* template tests

* SQL tests

* more tests

* set namespace for read resource permissions

* fix a bug with perms being removed right after they're added

* remove unwanted changes

* fix tests and check error

* PR feedback

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

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
Ieva
2025-09-12 10:43:51 +01:00
committed by GitHub
co-authored by Gabriel MABILLE
parent 1004b26a4a
commit d4399e6eda
11 changed files with 595 additions and 41 deletions
@@ -1,11 +1,11 @@
INSERT INTO {{ .Ident .PermissionTable }} (role_id, action, scope, created, updated, kind, attribute, identifier)
VALUES (
{{ .Arg $.RoleID }},
{{ .Arg $.Permission.Action }},
{{ .Arg $.Permission.Scope }},
{{ .Arg $.Now }},
{{ .Arg $.Now }},
{{ .Arg $.Permission.Kind }},
{{ .Arg $.Permission.Attribute }},
{{ .Arg $.Permission.Identifier }}
{{ .Arg .RoleID }},
{{ .Arg .Permission.Action }},
{{ .Arg .Permission.Scope }},
{{ .Arg .Now }},
{{ .Arg .Now }},
{{ .Arg .Permission.Kind }},
{{ .Arg .Permission.Attribute }},
{{ .Arg .Permission.Identifier }}
)