open-consul/ui-v2/app/components/consul-token-ruleset-list/index.hbs
John Cowen 59585f71a7
ui: Namespaces Redesign (#8336)
* ui: Add new consul-nspace-list component

* ui: Use new consul-nspace-list component

* Fix up other components to use linkable list-collection action

* ui: Remove some dead CSS
2020-07-20 18:12:34 +01:00

50 lines
1.4 KiB
Handlebars

{{#let (policy/group (or item.Policies item.ACLs.PolicyDefaults (array))) as |policies|}}
{{#let (get policies 'management') as |management|}}
{{#if (gt management.length 0)}}
<dl>
<dt>
Management
</dt>
<dd>
{{#each (get policies 'management') as |item|}}
<span data-test-policy class={{policy/typeof item}}>{{item.Name}}</span>
{{/each}}
</dd>
</dl>
{{/if}}
{{/let}}
{{#let (get policies 'identities') as |identities|}}
{{#if (gt identities.length 0)}}
<dl>
<dt>Identities</dt>
<dd>
{{#each identities as |item|}}
<span data-test-policy class={{policy/typeof item}}>{{item.Name}}</span>
{{/each}}
</dd>
</dl>
{{/if}}
{{/let}}
{{#if (token/is-legacy item) }}
<dl>
<dt>Rules</dt>
<dd>
Legacy tokens have embedded rules.
</dd>
</dl>
{{else}}
{{#let (append (get policies 'policies') (or item.Roles item.ACLs.RoleDefaults (array))) as |policies|}}
{{#if (gt policies.length 0)}}
<dl>
<dt>Rules</dt>
<dd>
{{#each policies as |item|}}
<span data-test-policy class={{policy/typeof item}}>{{item.Name}}</span>
{{/each}}
</dd>
</dl>
{{/if}}
{{/let}}
{{/if}}
{{/let}}