From 6b485b9f939bb940cf2fe34a738a4b4b0ecf9524 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sun, 5 Sep 2021 09:57:41 -0400 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20hide=20auth=20method?= =?UTF-8?q?=20create=20link=20when=20grants=20missing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/scopes/scope/auth-methods/index.hbs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index 9297cfd32..a2f2d0860 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -187,16 +187,12 @@ }} {{/if}} - - - {{t 'titles.new'}} - {{#if (can 'create collection' this.scope collection='auth-methods')}} - - + + {{t 'titles.new'}} {{/if}} From 07429878740930ca4eb532cb2f28418a8004d403 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sun, 5 Sep 2021 10:08:41 -0400 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20scope=20create=20show?= =?UTF-8?q?s=20only=20when=20permissions=20granted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/scopes/scope/scopes/index.hbs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/scopes/index.hbs b/ui/admin/app/templates/scopes/scope/scopes/index.hbs index 19a4168d5..18134a990 100644 --- a/ui/admin/app/templates/scopes/scope/scopes/index.hbs +++ b/ui/admin/app/templates/scopes/scope/scopes/index.hbs @@ -26,10 +26,12 @@ - {{#if @model.subScopes}} - - {{t 'titles.new'}} - + {{#if (can 'create collection' @model.currentScope collection='scopes')}} + {{#if @model.subScopes}} + + {{t 'titles.new'}} + + {{/if}} {{/if}} @@ -82,10 +84,14 @@ {{t 'resources.project.description'}} - - - {{t 'titles.new'}} - + {{#if + (can 'create collection' @model.currentScope collection='scopes') + }} + + + {{t 'titles.new'}} + + {{/if}} {{/if}} From 6458f928b9aef4cb6004cfbaae190fc21d2bdbd9 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 7 Sep 2021 14:20:49 -0400 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20lingering=20cap?= =?UTF-8?q?abilities=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scopes/scope/auth-methods/index.hbs | 52 ++++++++----------- .../templates/scopes/scope/scopes/index.hbs | 12 +++-- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index a2f2d0860..500beb452 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -12,28 +12,25 @@ - {{#if (can 'create collection' this.scopeModel collection='auth-methods')}} - {{#if @model}} - + - - {{t 'resources.auth-method.types.password'}} - - - {{t 'resources.auth-method.types.oidc'}} - - - {{/if}} + {{t 'resources.auth-method.types.password'}} + + + {{t 'resources.auth-method.types.oidc'}} + + {{/if}} @@ -168,11 +165,13 @@ as |message| > - {{#if (can 'list collection' this.scope collection='auth-methods')}} + {{#if + (can 'list collection' this.scopeModel collection='auth-methods') + }} {{! can list (at least): show default welcome message}} {{t 'resources.auth-method.messages.welcome.description'}} {{else if (can - 'create collection' this.scope collection='auth-methods' + 'create collection' this.scopeModel collection='auth-methods' )}} {{! can create (only): show create-but-not-list welcome message}} {{t @@ -187,15 +186,6 @@ }} {{/if}} - {{#if (can 'create collection' this.scope collection='auth-methods')}} - - - {{t 'titles.new'}} - - {{/if}} diff --git a/ui/admin/app/templates/scopes/scope/scopes/index.hbs b/ui/admin/app/templates/scopes/scope/scopes/index.hbs index 18134a990..4194cdc24 100644 --- a/ui/admin/app/templates/scopes/scope/scopes/index.hbs +++ b/ui/admin/app/templates/scopes/scope/scopes/index.hbs @@ -67,10 +67,14 @@ {{t 'resources.org.description'}} - - - {{t 'titles.new'}} - + {{#if + (can 'create collection' @model.currentScope collection='scopes') + }} + + + {{t 'titles.new'}} + + {{/if}} {{/if}}