{"record":{"id":"43f1eded4a3e0ed2","repo":"krayin/laravel-crm","slug":"this-action-is-unauthorized-43f1ed","errorCode":null,"errorMessage":"This action is unauthorized.","messagePattern":"This action is unauthorized\\.","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"packages/Webkul/Admin/src/Http/Middleware/Bouncer.php","lineNumber":58,"sourceCode":"            auth()->guard($guard)->logout();\n\n            session()->flash('error', trans('admin::app.errors.401'));\n\n            return redirect()->route('admin.session.create');\n        }\n\n        return $next($request);\n    }\n\n    /**\n     * Check for user, if they have empty permissions or not except admin.\n     *\n     * @return bool\n     */\n    public function isPermissionsEmpty()\n    {\n        if (! $role = auth()->guard('user')->user()->role) {\n            abort(401, 'This action is unauthorized.');\n        }\n\n        if ($role->permission_type === 'all') {\n            return false;\n        }\n\n        if ($role->permission_type !== 'all' && empty($role->permissions)) {\n            return true;\n        }\n\n        $this->checkIfAuthorized();\n\n        return false;\n    }\n\n    /**\n     * Check authorization.\n     *","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/krayin/laravel-crm/blob/13d6988cda8d69ece45ee1890effc90a7f21cdc1/packages/Webkul/Admin/src/Http/Middleware/Bouncer.php#L40-L76","documentation":"Error \"This action is unauthorized.\" thrown in krayin/laravel-crm.","triggerScenarios":"Thrown at packages/Webkul/Admin/src/Http/Middleware/Bouncer.php:58 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":"13d6988cda8d69ece45ee1890effc90a7f21cdc1","analyzedAt":"2026-08-17T00:58:29.000Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}