ui: Hide create buttons for policies/roles/namespaces with readonly access (#10914)
This PR adds a check to policy, role and namespace list pages to make sure the user has can write those things before offering to create them via a button. (The create page/form would then be a read-only form)
This commit is contained in:
parent
d157c63fe4
commit
ce731453ea
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
ui: hide create button for policies/roles/namespace if users token has no write permissions to those areas
|
||||
```
|
|
@ -69,7 +69,9 @@ as |route|>
|
|||
</h1>
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="actions">
|
||||
{{#if (can "create policies")}}
|
||||
<a data-test-create href="{{href-to 'dc.acls.policies.create'}}" class="type-create">Create</a>
|
||||
{{/if}}
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="toolbar">
|
||||
{{#if (gt items.length 0) }}
|
||||
|
|
|
@ -63,7 +63,9 @@ as |route|>
|
|||
</h1>
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="actions">
|
||||
{{#if (can "create roles")}}
|
||||
<a data-test-create href="{{href-to 'dc.acls.roles.create'}}" class="type-create">Create</a>
|
||||
{{/if}}
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="toolbar">
|
||||
{{#if (gt items.length 0) }}
|
||||
|
|
|
@ -55,7 +55,9 @@ as |route|>
|
|||
</h1>
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="actions">
|
||||
{{#if (can "create nspaces")}}
|
||||
<a data-test-create href="{{href-to 'dc.nspaces.create'}}" class="type-create">Create</a>
|
||||
{{/if}}
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="toolbar">
|
||||
{{#if (gt items.length 0)}}
|
||||
|
|
Loading…
Reference in New Issue