diff --git a/packages/builder/src/accessLevels/AccessLevelView.svelte b/packages/builder/src/accessLevels/AccessLevelView.svelte
index a21f768d7f..c5a985d5ed 100644
--- a/packages/builder/src/accessLevels/AccessLevelView.svelte
+++ b/packages/builder/src/accessLevels/AccessLevelView.svelte
@@ -24,12 +24,18 @@
((!p2.nodeKey && !p1.nodeKey) || p2.nodeKey === p1.nodeKey)
const hasPermission = hasPerm =>
- some(p => matchPermissions(p, hasPerm))(clonedLevel.permissions)
+ clonedLevel.permissions.some(permission =>
+ matchPermissions(permission, hasPerm)
+ )
- $: permissionMatrix = map(p => ({
- permission: p,
- hasPermission: hasPermission(p),
- }))(allPermissions)
+ $: permissionMatrix = allPermissions.map(permission => ({
+ permission,
+ hasPermission: hasPermission(permission),
+ }))
+
+ $: allPermissionsSelected = permissionMatrix.every(
+ permission => permission.hasPermission
+ )
const getPermissionName = perm =>
perm.nodeKey ? `${perm.type} - ${perm.nodeKey}` : perm.type
@@ -37,7 +43,7 @@
const save = () => {
const newLevels = isNew
? [...allLevels, clonedLevel]
- : [...filter(l => l.name !== level.name)(allLevels), clonedLevel]
+ : [...allLevels.filter(l => l.name !== level.name), clonedLevel]
errors = validateAccessLevels(hierarchy, actions, newLevels)
@@ -68,6 +74,15 @@