From deb77f31cb254405c1a516fb5f5fd52ce9c13182 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 23 Jun 2020 17:58:43 +0100 Subject: [PATCH] ui: Add namespaced versions of templated policies (#8173) --- ui-v2/app/components/node-identity/index.hbs | 15 ++++++++++++++- ui-v2/app/components/policy-form/index.hbs | 2 +- .../app/components/policy-selector/index.hbs | 4 ++-- .../app/components/service-identity/index.hbs | 19 ++++++++++++++++++- .../app/templates/dc/acls/policies/-form.hbs | 2 +- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ui-v2/app/components/node-identity/index.hbs b/ui-v2/app/components/node-identity/index.hbs index 7ee0bfa2e0..e570640bee 100644 --- a/ui-v2/app/components/node-identity/index.hbs +++ b/ui-v2/app/components/node-identity/index.hbs @@ -1,6 +1,19 @@ +{{#if (env "CONSUL_NSPACES_ENABLED")}} +namespace "default" { + node "{{name}}" { + policy = "write" + } +} +namespace_prefix "" { + service_prefix "" { + policy = "read" + } +} +{{else}} node "{{name}}" { policy = "write" } service_prefix "" { policy = "read" -} \ No newline at end of file +} +{{/if}} \ No newline at end of file diff --git a/ui-v2/app/components/policy-form/index.hbs b/ui-v2/app/components/policy-form/index.hbs index 01137a6526..6204c5e5b9 100644 --- a/ui-v2/app/components/policy-form/index.hbs +++ b/ui-v2/app/components/policy-form/index.hbs @@ -36,7 +36,7 @@ Rules (HCL Format) {{#if (eq item.template 'service-identity')}} - {{~component 'service-identity' name=item.Name~}} + {{~component 'service-identity' nspace=nspace name=item.Name~}} {{else if (eq item.template 'node-identity')}} diff --git a/ui-v2/app/components/policy-selector/index.hbs b/ui-v2/app/components/policy-selector/index.hbs index 38cbea1dfd..270e89f33a 100644 --- a/ui-v2/app/components/policy-selector/index.hbs +++ b/ui-v2/app/components/policy-selector/index.hbs @@ -21,7 +21,7 @@

New Policy

- +