{{- if and .Values.config.authz.enabled (not .Values.authz.existingConfigMap) .Values.authz.policies }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "barycenter.fullname" . }}-authz-policies
  labels:
    {{- include "barycenter.labels" . | nindent 4 }}
data:
  {{- range $filename, $content := .Values.authz.policies }}
  {{ $filename }}: |
    {{- $content | nindent 4 }}
  {{- end }}
{{- end }}
