Fixed: Prevented refund requests for service order lines belonging to other customers

Co-authored-by: Name <azharbhat.qlo098@webkul.in>
This commit is contained in:
amit sharma
2026-10-09 16:31:46 +05:30
parent df93538090
commit 38d780ab1a
6 changed files with 85 additions and 3 deletions

View File

@@ -1187,6 +1187,11 @@ class AdminControllerCore extends Controller
*/
public function processDeleteImage()
{
if ($this->tabAccess['delete'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to delete this.');
return false;
}
if (Validate::isLoadedObject($object = $this->loadObject())) {
if (($object->deleteImage())) {
$redirect = self::$currentIndex.'&update'.$this->table.'&'.$this->identifier.'='.Tools::getValue($this->identifier).'&conf=7&token='.$this->token;
@@ -1289,6 +1294,11 @@ class AdminControllerCore extends Controller
*/
public function processDelete()
{
if ($this->tabAccess['delete'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to delete this.');
return false;
}
if (Validate::isLoadedObject($object = $this->loadObject())) {
$res = true;
// check if request at least one object with noZeroObject
@@ -1351,6 +1361,11 @@ class AdminControllerCore extends Controller
*/
public function processAdd()
{
if ($this->tabAccess['add'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to add this.');
return false;
}
if (!isset($this->className) || empty($this->className)) {
return false;
}
@@ -1402,6 +1417,11 @@ class AdminControllerCore extends Controller
*/
public function processUpdate()
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
/* Checking fields validity */
$this->validateRules();
if (empty($this->errors)) {
@@ -1495,6 +1515,11 @@ class AdminControllerCore extends Controller
*/
public function processUpdateFields()
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
if (!is_array($fields = Tools::getValue('fieldsBox'))) {
$fields = array();
}
@@ -1519,6 +1544,11 @@ class AdminControllerCore extends Controller
*/
public function processStatus()
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
if (Validate::isLoadedObject($object = $this->loadObject())) {
if ($object->toggleStatus()) {
PrestaShopLogger::addLog(
@@ -1562,6 +1592,11 @@ class AdminControllerCore extends Controller
*/
public function processPosition()
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
if (!Validate::isLoadedObject($object = $this->loadObject())) {
$this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').
' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
@@ -1619,6 +1654,11 @@ class AdminControllerCore extends Controller
*/
protected function processUpdateOptions()
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
$this->beforeUpdateOptions();
$languages = Language::getLanguages(false);
@@ -4065,6 +4105,11 @@ class AdminControllerCore extends Controller
*/
protected function processBulkDelete()
{
if ($this->tabAccess['delete'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to delete this.');
return false;
}
if (is_array($this->boxes) && !empty($this->boxes)) {
$object = new $this->className();
@@ -4266,6 +4311,11 @@ class AdminControllerCore extends Controller
*/
protected function processBulkStatusSelection($status)
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
$result = true;
if (is_array($this->boxes) && !empty($this->boxes)) {
foreach ($this->boxes as $id) {
@@ -4298,6 +4348,11 @@ class AdminControllerCore extends Controller
*/
protected function processBulkAffectZone()
{
if ($this->tabAccess['edit'] !== 1) {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
return false;
}
$result = false;
if (is_array($this->boxes) && !empty($this->boxes)) {
/** @var Country|State $object */