1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

better naming, filter out public from inheritable roles

This commit is contained in:
Martin McKeaveney 2021-07-06 18:55:34 +01:00
parent 78bd36304e
commit a8277c9385

View file

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