diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue index 6f2be4bfe..0ade82bda 100644 --- a/src/components/common/VnSelectDialog.vue +++ b/src/components/common/VnSelectDialog.vue @@ -27,17 +27,17 @@ const $props = defineProps({ }); const role = useRole(); -const acl = useAcl() +const acl = useAcl(); const showForm = ref(false); const isAllowedToCreate = computed(() => { - if ($props.acls.length) console.log(acl.hasAny($props.acls)); - return role.hasAny($props.rolesAllowedToCreate); + const hasMissingAcl = $props.acls.some( + (x) => !acl.hasAny(x.model, x.props, x.accessType) + ); + const hasRequiredRole = role.hasAny($props.rolesAllowedToCreate); + if ($props.acls.length) return !hasMissingAcl; + return hasRequiredRole; }); - -const toggleForm = () => { - showForm.value = !showForm.value; -};