{{#if (eq @mode "create")}} Create Role {{else if (eq @mode "edit")}} Edit Role {{else}} {{@model.id}} {{/if}}

{{#if (eq @mode "show")}} {{#if @model.canDelete}} Delete role
{{/if}} {{#if @model.canGenerateCredentials}} {{/if}} {{#if @model.canEditRole}} Edit role {{/if}}
{{#each @model.showFields as |attr|}} {{#let attr.options.defaultShown as |defaultDisplay|}} {{#if (eq attr.type "object")}} {{else}} {{/if}} {{/let}} {{/each}} {{else}} {{! Edit or Create }}
{{#each @model.fieldAttrs as |attr|}} {{#if (eq @mode "edit")}} {{else if (not-eq attr.options.readOnly true)}} {{! TODO: If database && !updateDB show warning }} {{#if (get this.warningMessages attr.name)}} {{/if}} {{/if}} {{/each}}
{{#if (is-empty-value this.warningMessages)}} {{else}}
You don't have permissions required to {{if (eq @mode "create") "create" "update"}} this role. See form for details.
{{/if}}
Cancel
{{/if}}