public static function get_instance() { if (self::$instance == false) { self::$instance = new Authorization(); } return self::$instance; }
public function AllowedToAccess($module, $submodule, $action, $type) { if (Authentication::instance()->checkValidationAppClint() && Authorization::instance()->IsAllowedToAccess($module, $submodule, $action, $type, Authentication::instance()->getApplicationId())) { return true; } elseif (!Authentication::instance()->checkValidationAppClint() && Authorization::instance()->IsAllowedToAccess($module, $submodule, $action, $type, Authentication::instance()->getApplicationId())) { return true; } else { $dbMsg = SysLog::Instance()->getAllError(); if (!empty($dbMsg)) { echo "<pre>"; for ($i = 0; $i < count($dbMsg); $i++) { echo $dbMsg[$i]; } echo "</pre>"; } Log::Instance()->SendLog('Gagal akses, request denied'); die('You don\'t have permission to access this service'); } }