prevent editing public role in apps

This commit is contained in:
Martin McKeaveney 2021-07-06 18:54:08 +01:00
parent 13517d5298
commit 78bd36304e
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@
let selectedRole = {}
let errors = []
let builtInRoles = ["Admin", "Power", "Basic", "Public"]
// Don't allow editing of public role
$: allRoles = $roles.filter(role => role._id !== "PUBLIC")
$: selectedRoleId = selectedRole._id
$: otherRoles = $roles.filter(role => role._id !== selectedRoleId)
$: isCreating = selectedRoleId == null || selectedRoleId === ""
@ -96,7 +98,7 @@
label="Role"
value={selectedRoleId}
on:change={changeRole}
options={$roles}
options={allRoles}
placeholder="Create new role"
getOptionValue={role => role._id}
getOptionLabel={role => role.name}