open-consul/ui/packages/consul-ui/app/templates/application.hbs
John Cowen dc183b1786
ui: Restrict the viewing/editing of certain UI elements based on the users ACLs (#9687)
This commit use the internal authorize endpoint along wiht ember-can to further restrict user access to certain UI features and navigational elements depending on the users ACL token
2021-02-19 16:42:16 +00:00

38 lines
894 B
Handlebars

<HeadLayout />
{{page-title 'Consul' separator=' - '}}
{{#if (env 'CONSUL_ACLS_ENABLED')}}
{{document-attrs class="has-acls"}}
{{/if}}
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
{{document-attrs class="has-nspaces"}}
{{/if}}
<DataSource
@src="settings://consul:theme"
as |source|>
{{#each-in source.data as |key value|}}
{{#if (and value (contains key (array "color-scheme" "contrast")))}}
{{document-attrs class=(concat 'prefers-' key '-' value)}}
{{/if}}
{{/each-in}}
</DataSource>
{{#if (not-eq router.currentRouteName 'application')}}
<HashicorpConsul
id="wrapper"
@dcs={{dcs}}
@dc={{or dc dcs.firstObject}}
@nspaces={{nspaces}}
@nspace={{or nspace nspaces.firstObject}}
@onchange={{action "reauthorize"}}
>
<Outlet
@name="application"
as |o|>
{{outlet}}
</Outlet>
<Consul::Loader class="view-loader" />
</HashicorpConsul>
{{/if}}