2023-05-04 10:50:19 +02:00
|
|
|
// Code generated by protoc-gen-zitadel. DO NOT EDIT.
|
|
|
|
|
|
|
|
package {{.GoPackageName}}
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
2023-09-13 14:43:01 +02:00
|
|
|
{{if .AuthContext}}"github.com/zitadel/zitadel/internal/api/grpc/server/middleware"{{end}}
|
2023-05-04 10:50:19 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var {{.ServiceName}}_AuthMethods = authz.MethodMapping {
|
|
|
|
{{ range $m := .AuthOptions}}
|
|
|
|
{{$.ServiceName}}_{{$m.Name}}_FullMethodName: authz.Option{
|
|
|
|
Permission: "{{$m.Permission}}",
|
|
|
|
CheckParam: "{{$m.CheckFieldName}}",
|
|
|
|
},
|
|
|
|
{{ end}}
|
|
|
|
}
|
|
|
|
|
|
|
|
{{ range $m := .AuthContext}}
|
2023-10-13 15:37:35 +03:00
|
|
|
func (r *{{ $m.Name }}) OrganizationFromRequest() *middleware.Organization {
|
|
|
|
return &middleware.Organization{
|
2023-09-13 14:43:01 +02:00
|
|
|
ID: r{{$m.OrgMethod}}.GetOrgId(),
|
|
|
|
Domain: r{{$m.OrgMethod}}.GetOrgDomain(),
|
|
|
|
}
|
2023-05-04 10:50:19 +02:00
|
|
|
}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ range $resp := .CustomHTTPResponses}}
|
|
|
|
func (r *{{ $resp.Name }}) CustomHTTPCode() int {
|
|
|
|
return {{$resp.Code}}
|
|
|
|
}
|
|
|
|
{{ end }}
|