Files
threshold-ui/ui/admin/app/components/roles/role/actions/index.hbs
T
Cameron Perera 4cd56f8ae5 Icu 17393 manage resource button permissions bug (#2927)
* fix: 🐛 hide manage button if no action items

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for credential-stores

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for groups

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for host-sets

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for roles

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage action for targets

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for workers

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for users

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393

* fix: 🐛 update manage actions for auth-methods

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17393
2025-07-15 14:03:27 -05:00

47 lines
1.4 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
{{#let
(hash
canAddPrincipals=(can 'addPrincipals role' @model)
canSetGrantScopes=(can 'setGrantScopes role' @model)
canDelete=(can 'delete model' @model)
)
as |perms|
}}
{{#if (or perms.canAddPrincipals perms.canSetGrantScopes perms.canDelete)}}
<Hds::Dropdown data-test-manage-roles-dropdown as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if perms.canAddPrincipals}}
<dd.Interactive
@route='scopes.scope.roles.role.add-principals'
data-test-manage-role-principals
>
{{t 'resources.role.principal.actions.add-principals'}}
</dd.Interactive>
{{/if}}
{{#if perms.canSetGrantScopes}}
<dd.Interactive
@route='scopes.scope.roles.role.manage-scopes'
data-test-manage-dropdown-scopes
>
{{t 'resources.role.scope.actions.manage-scopes'}}
</dd.Interactive>
{{/if}}
{{#if perms.canDelete}}
{{#if (or perms.canAddPrincipals perms.canSetGrantScopes)}}
<dd.Separator />
{{/if}}
<dd.Interactive
@color='critical'
@disabled={{@model.canSave}}
{{on 'click' (fn @delete @model)}}
>
{{t 'resources.role.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
{{/if}}
{{/let}}