Skip to content

Commit 01e5ddf

Browse files
committed
fix: more conditionals in the template for different scope of resources
1 parent ae79d8a commit 01e5ddf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/subroutine/authorization_model_generation.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ type AuthorizationModelGenerationSubroutine struct {
4141

4242
var modelTpl = template.Must(template.New("model").Parse(`module {{ .Name }}
4343
44+
{{ if eq .Scope "Cluster" }}
4445
extend type core_platform-mesh_io_account
4546
relations
4647
define create_{{ .Group }}_{{ .Name }}: member
4748
define list_{{ .Group }}_{{ .Name }}: member
4849
define watch_{{ .Group }}_{{ .Name }}: member
50+
{{ end }}
4951
5052
{{ if eq .Scope "Namespaced" }}
5153
extend type core_namespace

0 commit comments

Comments
 (0)