From 3cb5bbb0f81019a1061e90cf4b8f6c692dbef267 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 4 Nov 2020 15:24:34 -0800 Subject: [PATCH] Show a partial view notice when ACLs are enabled and the mgmt token isn't being used --- ui/app/abilities/job.js | 6 ++++++ ui/app/styles/components/tooltip.scss | 1 + ui/app/templates/topology.hbs | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ui/app/abilities/job.js b/ui/app/abilities/job.js index 7b96096b3..8b2d8fcf8 100644 --- a/ui/app/abilities/job.js +++ b/ui/app/abilities/job.js @@ -14,6 +14,12 @@ export default class Job extends AbstractAbility { ) canScale; + // TODO: A person can also see all jobs if their token grants read access to all namespaces, + // but given the complexity of namespaces and policy precedence, there isn't a good quick way + // to confirm this. + @or('bypassAuthorization', 'selfTokenIsManagement') + canListAll; + @computed('rulesForActiveNamespace.@each.capabilities') get policiesSupportRunning() { return this.activeNamespaceIncludesCapability('submit-job'); diff --git a/ui/app/styles/components/tooltip.scss b/ui/app/styles/components/tooltip.scss index 62c04fb48..0e4e28497 100644 --- a/ui/app/styles/components/tooltip.scss +++ b/ui/app/styles/components/tooltip.scss @@ -4,6 +4,7 @@ } .tooltip::after { + text-transform: none; content: attr(aria-label); background: $black; border-radius: $radius; diff --git a/ui/app/templates/topology.hbs b/ui/app/templates/topology.hbs index 820e5c385..856a70a96 100644 --- a/ui/app/templates/topology.hbs +++ b/ui/app/templates/topology.hbs @@ -7,7 +7,12 @@
-
Legend
+
+ Legend + {{#if (cannot "list all jobs")}} + Partial View + {{/if}} +

Metrics