mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-09 08:48:26 +01:00
Check for good measure again, that a user is able to edit an entity in an admin form
issue #1283
This commit is contained in:
@@ -195,6 +195,8 @@ abstract class BaseAdminController extends AbstractController
|
||||
|
||||
$this->commentHelper->setMessage($form['log_comment']->getData());
|
||||
|
||||
//In principle, the form should be disabled, if the edit permission is not granted, but for good measure, we also check it here, before saving changes.
|
||||
$this->denyAccessUnlessGranted('edit', $entity);
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
$this->addFlash('success', 'entity.edit_flash');
|
||||
|
||||
@@ -121,6 +121,7 @@ class BaseEntityAdminForm extends AbstractType
|
||||
'label' => 'entity.edit.alternative_names.label',
|
||||
'help' => 'entity.edit.alternative_names.help',
|
||||
'empty_data' => null,
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
'attr' => [
|
||||
'class' => 'tagsinput',
|
||||
'data-controller' => 'elements--tagsinput',
|
||||
|
||||
Reference in New Issue
Block a user