prevent editing public role in apps
This commit is contained in:
parent
93b562e2df
commit
da800dd3fc
|
@ -10,6 +10,8 @@
|
||||||
let selectedRole = {}
|
let selectedRole = {}
|
||||||
let errors = []
|
let errors = []
|
||||||
let builtInRoles = ["Admin", "Power", "Basic", "Public"]
|
let builtInRoles = ["Admin", "Power", "Basic", "Public"]
|
||||||
|
// Don't allow editing of public role
|
||||||
|
$: allRoles = $roles.filter(role => role._id !== "PUBLIC")
|
||||||
$: selectedRoleId = selectedRole._id
|
$: selectedRoleId = selectedRole._id
|
||||||
$: otherRoles = $roles.filter(role => role._id !== selectedRoleId)
|
$: otherRoles = $roles.filter(role => role._id !== selectedRoleId)
|
||||||
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
||||||
|
@ -96,7 +98,7 @@
|
||||||
label="Role"
|
label="Role"
|
||||||
value={selectedRoleId}
|
value={selectedRoleId}
|
||||||
on:change={changeRole}
|
on:change={changeRole}
|
||||||
options={$roles}
|
options={allRoles}
|
||||||
placeholder="Create new role"
|
placeholder="Create new role"
|
||||||
getOptionValue={role => role._id}
|
getOptionValue={role => role._id}
|
||||||
getOptionLabel={role => role.name}
|
getOptionLabel={role => role.name}
|
||||||
|
|
Loading…
Reference in New Issue