| Server IP : 37.9.174.138 / Your IP : 216.73.216.117 Web Server : Apache System : Linux vps6.backend.sk 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 User : ftpuser ( 1001) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/backend-accounting.sk/app/modules/users/code/ |
Upload File : |
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace modules\users\code;
/**
* Description of UsersConfig
*
* @author maros
*/
class UsersConfig extends \app\classes\ModuleConfig {
CONST CONF_USERS_TYPES_MANAGEMENT = "CONF_USERS_TYPES_MANAGEMENT";
public function __construct() {
parent::__construct(__CLASS__);
}
public function hasUserTypeManagementPermission($subType, $superType = false) {
if ($superType === false) {
try {
$user = BasicUser::getLoggedUser();
$superType = $user->_get("type");
} catch (\Exception $ex) {
return false;
}
}
if (!isset($this->getConfig(self::CONF_USERS_TYPES_MANAGEMENT)[$superType])) {
return false;
}
return in_array($subType, $this->getConfig(self::CONF_USERS_TYPES_MANAGEMENT)[$superType]);
}
public function verifyUserTypeManagementPermission($subType, $superType = false) {
if (!$this->hasUserTypeManagementPermission($subType, $superType)) {
throw new \Exception(\app\constants\ResponseCodes::ACCESS_DENIED, \app\constants\ResponseCodes::ACCESS_DENIED);
}
}
}