mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
95889cf576
* fix(api): use organization instead of organisation * fix test * docs: add deprecation notice * remove validation
33 lines
882 B
Cheetah
33 lines
882 B
Cheetah
// Code generated by protoc-gen-zitadel. DO NOT EDIT.
|
|
|
|
package {{.GoPackageName}}
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
{{if .AuthContext}}"github.com/zitadel/zitadel/internal/api/grpc/server/middleware"{{end}}
|
|
)
|
|
|
|
var {{.ServiceName}}_AuthMethods = authz.MethodMapping {
|
|
{{ range $m := .AuthOptions}}
|
|
{{$.ServiceName}}_{{$m.Name}}_FullMethodName: authz.Option{
|
|
Permission: "{{$m.Permission}}",
|
|
CheckParam: "{{$m.CheckFieldName}}",
|
|
},
|
|
{{ end}}
|
|
}
|
|
|
|
{{ range $m := .AuthContext}}
|
|
func (r *{{ $m.Name }}) OrganizationFromRequest() *middleware.Organization {
|
|
return &middleware.Organization{
|
|
ID: r{{$m.OrgMethod}}.GetOrgId(),
|
|
Domain: r{{$m.OrgMethod}}.GetOrgDomain(),
|
|
}
|
|
}
|
|
{{ end }}
|
|
|
|
{{ range $resp := .CustomHTTPResponses}}
|
|
func (r *{{ $resp.Name }}) CustomHTTPCode() int {
|
|
return {{$resp.Code}}
|
|
}
|
|
{{ end }}
|