Files
grafana/pkg/registry/apis/iam/resourcepermission/queries/permission_insert.sql
IevaandGabriel MABILLE d4399e6eda 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>
2025-09-12 10:43:51 +01:00

12 lines
369 B
SQL

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