Merge pull request #1063 from yashank09/master

disables input to edit builtin role name
This commit is contained in:
Martin McKeaveney 2021-01-31 12:40:36 +00:00 committed by GitHub
commit 0a45b7ee89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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