mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Forbid building of a part, when the user is not allowed to withdraw parts stock
This commit is contained in:
parent
2f42eb7cff
commit
78eacd3ec1
2 changed files with 14 additions and 1 deletions
|
@ -92,6 +92,9 @@ class ProjectController extends AbstractController
|
|||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted()) {
|
||||
if ($form->isValid()) {
|
||||
//Ensure that the user can withdraw stock from all parts
|
||||
$this->denyAccessUnlessGranted('@parts_stock.withdraw');
|
||||
|
||||
//We have to do a flush already here, so that the newly created partLot gets an ID and can be logged to DB later.
|
||||
$entityManager->flush();
|
||||
$buildHelper->doBuild($projectBuildRequest);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue