mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-16 21:08:00 +00:00
f1534c0c4c
* refactor: use new protoc plugin for api v2 * simplify code
30 lines
781 B
Cheetah
30 lines
781 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/pkg/grpc/object/v2alpha"{{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 }}) OrganisationFromRequest() *object.Organisation {
|
|
return r{{$m.OrgMethod}}
|
|
}
|
|
{{ end }}
|
|
|
|
{{ range $resp := .CustomHTTPResponses}}
|
|
func (r *{{ $resp.Name }}) CustomHTTPCode() int {
|
|
return {{$resp.Code}}
|
|
}
|
|
{{ end }}
|