Skip to content

Commit a6312a1

Browse files
author
Carlos Garcia
committed
Solucionado bug al imprimir desde los formularios de edición de facturas, albaranes, etc ... no estaba comprobando el permiso de exportación del usuario.
1 parent 65017a6 commit a6312a1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Core/Lib/AjaxForms/PurchasesController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* This file is part of FacturaScripts
4-
* Copyright (C) 2021-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
4+
* Copyright (C) 2021-2026 Carlos Garcia Gomez <carlos@facturascripts.com>
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as
@@ -28,7 +28,6 @@
2828
use FacturaScripts\Core\Lib\ExtendedController\PanelController;
2929
use FacturaScripts\Core\Model\Base\BusinessDocumentLine;
3030
use FacturaScripts\Core\Model\Base\PurchaseDocument;
31-
use FacturaScripts\Core\Model\LogMessage;
3231
use FacturaScripts\Core\Tools;
3332
use FacturaScripts\Dinamic\Lib\AssetManager;
3433
use FacturaScripts\Dinamic\Model\Proveedor;
@@ -239,6 +238,11 @@ protected function execPreviousAction($action)
239238

240239
protected function exportAction()
241240
{
241+
if (false === $this->permissions->allowExport) {
242+
Tools::log()->warning('no-print-permission');
243+
return;
244+
}
245+
242246
$this->setTemplate(false);
243247

244248
$subjectLang = $this->views[static::MAIN_VIEW_NAME]->model->getSubject()->langcode;

Core/Lib/AjaxForms/SalesController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* This file is part of FacturaScripts
4-
* Copyright (C) 2021-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
4+
* Copyright (C) 2021-2026 Carlos Garcia Gomez <carlos@facturascripts.com>
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as
@@ -28,7 +28,6 @@
2828
use FacturaScripts\Core\Lib\ExtendedController\PanelController;
2929
use FacturaScripts\Core\Model\Base\SalesDocument;
3030
use FacturaScripts\Core\Model\Base\SalesDocumentLine;
31-
use FacturaScripts\Core\Model\LogMessage;
3231
use FacturaScripts\Core\Tools;
3332
use FacturaScripts\Dinamic\Lib\AssetManager;
3433
use FacturaScripts\Dinamic\Model\Cliente;
@@ -240,6 +239,11 @@ protected function execPreviousAction($action)
240239

241240
protected function exportAction()
242241
{
242+
if (false === $this->permissions->allowExport) {
243+
Tools::log()->warning('no-print-permission');
244+
return;
245+
}
246+
243247
$this->setTemplate(false);
244248

245249
$subjectLang = $this->views[static::MAIN_VIEW_NAME]->model->getSubject()->langcode;

0 commit comments

Comments
 (0)