disables input to edit builtin role name

This commit is contained in:
Yashank 2021-01-31 04:24:33 -08:00
parent 86c4594c0d
commit 553386df35
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@
let permissions = []
let selectedRole = {}
let errors = []
let builtInRoles = ['Admin', 'Power', 'Basic', 'Public']
$: selectedRoleId = selectedRole._id
$: otherRoles = $backendUiStore.roles.filter(
role => role._id !== selectedRoleId
@ -102,7 +103,7 @@
{/each}
</Select>
{#if selectedRole}
<Input label="Name" bind:value={selectedRole.name} thin />
<Input label="Name" bind:value={selectedRole.name} thin disabled={builtInRoles.includes(selectedRole.name)}/>
<Select
thin
secondary