Skip to content
Permalink
Browse files

Fix privilege check in create case

  • Loading branch information...
flack committed Mar 26, 2019
1 parent 3222b4a commit f16f44f67c2e4d760ef658402c8c83cc8a1c2f9a
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/midcom/datamanager/extension/formExtension.php
@@ -62,13 +62,15 @@ public function buildView(FormView $view, FormInterface $form, array $options)
}
if (array_key_exists('privilege', $options['write_privilege'])) {
$storage = $form->getParent()->getData();
if ( $storage instanceof dbacontainer
&& (!$storage->get_value()->can_do($options['write_privilege']['privilege']))) {
$view->vars['readonly'] = true;
if ($storage instanceof dbacontainer) {
if ($storage->get_value()->id) {
$view->vars['readonly'] = !$storage->get_value()->can_do($options['write_privilege']['privilege']);
} else {
$view->vars['readonly'] = !$storage->get_value()->can_user_do($options['write_privilege']['privilege']);
}
}
}
}
}
// Symfony < 4.2 compat

0 comments on commit f16f44f

Please sign in to comment.
You can’t perform that action at this time.