Skip to content

Commit

Permalink
YForm Rechte - auch view berücksichtigen
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaddade committed Jun 21, 2022
1 parent 90e9e2a commit 648652e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Watson/Workflows/YForm/YFormSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 648652e

Please sign in to comment.