From 648652e2193e3b604f3911e599d3cb413e774123 Mon Sep 17 00:00:00 2001 From: tbaddade Date: Tue, 21 Jun 2022 17:07:09 +0200 Subject: [PATCH] =?UTF-8?q?YForm=20Rechte=20-=20auch=20view=20ber=C3=BCcks?= =?UTF-8?q?ichtigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Watson/Workflows/YForm/YFormSearch.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Watson/Workflows/YForm/YFormSearch.php b/lib/Watson/Workflows/YForm/YFormSearch.php index cab4544..e26338b 100644 --- a/lib/Watson/Workflows/YForm/YFormSearch.php +++ b/lib/Watson/Workflows/YForm/YFormSearch.php @@ -69,9 +69,15 @@ public function fire(Command $command) if (count($tables)) { $results = []; $viewFields = ['title', 'title_1', 'name', 'lastname', 'last_name', 'surname']; - $complexPerm = version_compare($yform->getVersion(), '4.0.0-beta1', '>=') ? 'yform_manager_table_edit' : 'yform_manager_table'; + $yForm4 = (bool) version_compare($yform->getVersion(), '4.0.0-beta1', '>='); + $rexUser = \rex::getUser(); foreach ($tables as $table) { - if ($table->isActive() && \rex::getUser()->getComplexPerm($complexPerm)->hasPerm($table->getTableName())) { + if (!$table->isActive()) { + continue; + } + + if (($yForm4 && ($rexUser->getComplexPerm('yform_manager_table_edit')->hasPerm($table->getTableName()) || $rexUser->getComplexPerm('yform_manager_table_view')->hasPerm($table->getTableName()))) + || (!$yForm4 && $rexUser->getComplexPerm('yform_manager_table')->hasPerm($table->getTableName()))) { $fields = $table->getValueFields(); foreach ($fields as $fieldName => $field) {