better naming, filter out public from inheritable roles
This commit is contained in:
parent
da800dd3fc
commit
dbef8077f0
|
@ -11,9 +11,9 @@
|
||||||
let errors = []
|
let errors = []
|
||||||
let builtInRoles = ["Admin", "Power", "Basic", "Public"]
|
let builtInRoles = ["Admin", "Power", "Basic", "Public"]
|
||||||
// Don't allow editing of public role
|
// Don't allow editing of public role
|
||||||
$: allRoles = $roles.filter(role => role._id !== "PUBLIC")
|
$: editableRoles = $roles.filter(role => role._id !== "PUBLIC")
|
||||||
$: selectedRoleId = selectedRole._id
|
$: selectedRoleId = selectedRole._id
|
||||||
$: otherRoles = $roles.filter(role => role._id !== selectedRoleId)
|
$: otherRoles = $editableRoles.filter(role => role._id !== selectedRoleId)
|
||||||
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
||||||
|
|
||||||
const fetchBasePermissions = async () => {
|
const fetchBasePermissions = async () => {
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
label="Role"
|
label="Role"
|
||||||
value={selectedRoleId}
|
value={selectedRoleId}
|
||||||
on:change={changeRole}
|
on:change={changeRole}
|
||||||
options={allRoles}
|
options={editableRoles}
|
||||||
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