| Linux hosting5.siteguarding.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64 Path : /home/devsafetybis/op4103.dev.safetybis.com/admin1qw/controller/startup/ |
| Current File : /home/devsafetybis/op4103.dev.safetybis.com/admin1qw/controller/startup/permission.php |
<?php
namespace Opencart\Admin\Controller\Startup;
/**
* Class Permission
*
* @package Opencart\Admin\Controller\Startup
*/
class Permission extends \Opencart\System\Engine\Controller {
/**
* Index
*
* @return \Opencart\System\Engine\Action|null
*/
public function index(): ?\Opencart\System\Engine\Action {
if (isset($this->request->get['route'])) {
$pos = strrpos($this->request->get['route'], '.');
if ($pos === false) {
$route = $this->request->get['route'];
} else {
$route = substr($this->request->get['route'], 0, $pos);
}
// We want to ignore some pages from having its permission checked.
$ignore = [
'common/dashboard',
'common/login',
'common/logout',
'common/forgotten',
'common/authorize',
'common/language',
'error/not_found',
'error/permission'
];
if (!in_array($route, $ignore) && !$this->user->hasPermission('access', $route)) {
return new \Opencart\System\Engine\Action('error/permission');
}
}
return null;
}
}