2023-03-14 13:18:55 +00:00
|
|
|
{{!
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
|
|
|
SPDX-License-Identifier: MPL-2.0
|
|
|
|
}}
|
|
|
|
|
2019-05-01 18:09:29 +00:00
|
|
|
{{yield}}
|
2021-03-11 09:29:11 +00:00
|
|
|
<fieldset
|
|
|
|
class="role-form"
|
2021-04-06 12:40:40 +00:00
|
|
|
disabled={{if (not (can "write role" item=item)) "disabled"}}
|
2021-03-11 09:29:11 +00:00
|
|
|
data-test-role-form
|
2021-04-06 12:40:40 +00:00
|
|
|
...attributes
|
2021-03-11 09:29:11 +00:00
|
|
|
>
|
2019-05-01 18:09:29 +00:00
|
|
|
<label class="type-text{{if item.error.Name ' has-error'}}">
|
|
|
|
<span>Name</span>
|
|
|
|
<input type="text" value={{item.Name}} name="role[Name]" autofocus="autofocus" oninput={{action 'change'}} />
|
|
|
|
<em>
|
|
|
|
Maximum 256 characters. May only include letters (uppercase and/or lowercase) and/or numbers. Must be unique.
|
|
|
|
</em>
|
|
|
|
{{#if item.error.Name}}
|
|
|
|
<strong>{{item.error.Name.validation}}</strong>
|
|
|
|
{{/if}}
|
|
|
|
</label>
|
|
|
|
<label class="type-text">
|
|
|
|
<span>Description (Optional)</span>
|
|
|
|
<textarea name="role[Description]" value={{item.Description}} oninput={{action 'change'}}></textarea>
|
|
|
|
</label>
|
|
|
|
</fieldset>
|
|
|
|
{{!TODO: temporary policies id, look at the inception token modals and get rid of id="policies" and use something else}}
|
|
|
|
<fieldset id="policies" class="policies">
|
|
|
|
<h2>Policies</h2>
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#yield-slot name='policy' params=(block-params item)}}
|
2019-05-01 18:09:29 +00:00
|
|
|
{{yield}}
|
|
|
|
{{else}}
|
2021-03-11 09:29:11 +00:00
|
|
|
<PolicySelector
|
|
|
|
@disabled={{not (can "write role" item=item)}}
|
|
|
|
@dc={{dc}}
|
2021-09-15 18:50:11 +00:00
|
|
|
@partition={{partition}}
|
2021-03-11 09:29:11 +00:00
|
|
|
@nspace={{nspace}}
|
|
|
|
@items={{item.Policies}}
|
|
|
|
/>
|
2019-05-01 18:09:29 +00:00
|
|
|
{{/yield-slot}}
|
|
|
|
</fieldset>
|