feat: 🎸 user capabilities
This commit is contained in:
1 parent
6e95686b9a
commit
119cbbe815
9 files changed
+281
-155
No files matched your search
@@ -45,12 +45,12 @@
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -37,9 +37,13 @@
|
||||
{{#each @model as |user|}}
|
||||
<body.row as |row|>
|
||||
<row.headerCell>
|
||||
<LinkTo @route='scopes.scope.users.user' @model={{user.id}}>
|
||||
{{#if (can 'read model' user)}}
|
||||
<LinkTo @route='scopes.scope.users.user' @model={{user.id}}>
|
||||
{{user.displayName}}
|
||||
</LinkTo>
|
||||
{{else}}
|
||||
{{user.displayName}}
|
||||
</LinkTo>
|
||||
{{/if}}
|
||||
<p>{{user.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
<Rose::Dropdown
|
||||
@text='{{t 'actions.manage'}}'
|
||||
@dropdownRight={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.link @route='scopes.scope.users.user.add-accounts'>
|
||||
{{t 'resources.user.actions.add-accounts'}}
|
||||
</dropdown.link>
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
{{on 'click' (route-action 'delete' @model)}}
|
||||
{{#if (can 'delete model' @model)}}
|
||||
<Rose::Dropdown
|
||||
@text='{{t 'actions.manage'}}'
|
||||
@dropdownRight={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
{{t 'resources.user.actions.delete'}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
<dropdown.link @route='scopes.scope.users.user.add-accounts'>
|
||||
{{t 'resources.user.actions.add-accounts'}}
|
||||
</dropdown.link>
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
{{on 'click' (route-action 'delete' @model)}}
|
||||
>
|
||||
{{t 'resources.user.actions.delete'}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
{{/if}}
|
||||
Reference in new issue
Block a user