feat: 🎸 implement add- and remove-principals abilities

This commit is contained in:
Randall Morey committed 2021-09-30 16:04:02 -04:00
1 parent 3022ca5a53
commit 8da8fddf29
6 files changed
+82 -17

No files matched your search

@@ -3,9 +3,11 @@
@dropdownRight={{true}}
as |dropdown|
>
<dropdown.link @route='scopes.scope.roles.role.add-principals'>
{{t 'resources.role.principal.actions.add-principals'}}
</dropdown.link>
{{#if (can 'addPrincipals role' @model)}}
<dropdown.link @route='scopes.scope.roles.role.add-principals'>
{{t 'resources.role.principal.actions.add-principals'}}
</dropdown.link>
{{/if}}
{{#if (can 'delete model' @model)}}
<dropdown.separator />
<dropdown.button
@@ -30,21 +30,26 @@
</Copyable>
</row.cell>
<row.cell>
<Rose::Dropdown
@icon='flight-icons/svg/more-horizontal-16'
@iconOnly={{true}}
@showCaret={{false}}
@dropdownRight={{true}}
@text='{{t 'actions.manage'}}'
as |dropdown|
>
<dropdown.button
@style='danger'
{{on 'click' (route-action 'removePrincipal' principal.model)}}
{{#if (can 'removePrincipals role' @model.role)}}
<Rose::Dropdown
@icon='flight-icons/svg/more-horizontal-16'
@iconOnly={{true}}
@showCaret={{false}}
@dropdownRight={{true}}
@text='{{t 'actions.manage'}}'
as |dropdown|
>
{{t 'actions.remove'}}
</dropdown.button>
</Rose::Dropdown>
<dropdown.button
@style='danger'
{{on
'click'
(route-action 'removePrincipal' principal.model)
}}
>
{{t 'actions.remove'}}
</dropdown.button>
</Rose::Dropdown>
{{/if}}
</row.cell>
</body.row>
{{/each}}