{{- $roles := split (.Get "roles") "," -}} {{- $capability := .Get "capability" -}} {{- $roleCount := len $roles -}}
You need the {{ index $roles 0 }} role{{ if $capability }} to {{ $capability }}{{ end }}.
{{- else if eq $roleCount 2 -}}You need the {{ index $roles 0 }} or {{ index $roles 1 }} role{{ if $capability }} to {{ $capability }}{{ end }}.
{{- else -}}You need one of the following roles{{ if $capability }} to {{ $capability }}{{ end }}: