2023-05-04 08:50:19 +00:00
|
|
|
// Code generated by protoc-gen-zitadel. DO NOT EDIT.
|
|
|
|
|
|
|
|
package {{.GoPackageName}}
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
2023-09-13 12:43:01 +00:00
|
|
|
{{if .AuthContext}}"github.com/zitadel/zitadel/internal/api/grpc/server/middleware"{{end}}
|
2023-05-04 08:50:19 +00: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 12:37:35 +00:00
|
|
|
func (r *{{ $m.Name }}) OrganizationFromRequest() *middleware.Organization {
|
|
|
|
return &middleware.Organization{
|
2023-09-13 12:43:01 +00:00
|
|
|
ID: r{{$m.OrgMethod}}.GetOrgId(),
|
|
|
|
Domain: r{{$m.OrgMethod}}.GetOrgDomain(),
|
|
|
|
}
|
2023-05-04 08:50:19 +00:00
|
|
|
}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ range $resp := .CustomHTTPResponses}}
|
|
|
|
func (r *{{ $resp.Name }}) CustomHTTPCode() int {
|
|
|
|
return {{$resp.Code}}
|
|
|
|
}
|
|
|
|
{{ end }}
|