{"record":{"id":"d1ecd7c90c3f3f31","repo":"Leantime/leantime","slug":"errors-error403","errorCode":null,"errorMessage":"/errors/error403","messagePattern":"/errors/error403","errorType":"http","errorClass":"Illuminate\\Http\\Exceptions\\HttpResponseException","httpStatus":403,"severity":"error","filePath":"app/Domain/Auth/Services/Auth.php","lineNumber":625,"sourceCode":"        $currentUserKey = array_search($roleToCheck, Roles::getRoles());\n\n        if ($testKey <= $currentUserKey) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @throws HttpResponseException\n     */\n    public static function authOrRedirect(array|string $role, bool $forceGlobalRoleCheck = false): bool\n    {\n        if (self::userHasRole($role, $forceGlobalRoleCheck)) {\n            return true;\n        }\n\n        throw new HttpResponseException(FrontcontrollerCore::redirect(BASE_URL.'/errors/error403'));\n    }\n\n    /**\n     * @throws BindingResolutionException\n     */\n    public static function userHasRole(string|array $role, bool $forceGlobalRoleCheck = false): bool\n    {\n\n        // Force Global Role check to circumvent projectRole checks for global controllers (users, projects, clients etc)\n        $roleToCheck = self::getRoleToCheck($forceGlobalRoleCheck);\n\n        if (is_array($role) && in_array($roleToCheck, $role)) {\n            return true;\n        } elseif ($role == $roleToCheck) {\n            return true;\n        }\n\n        return false;","sourceCodeStart":607,"sourceCodeEnd":643,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Auth/Services/Auth.php#L607-L643","documentation":"Error \"/errors/error403\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Auth/Services/Auth.php:625 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}