krayin/laravel-crm · error

This action is unauthorized.

Error message

This action is unauthorized.

What it means

Error "This action is unauthorized." thrown in krayin/laravel-crm.

Source

Thrown at packages/Webkul/Admin/src/Http/Middleware/Bouncer.php:58

            auth()->guard($guard)->logout();

            session()->flash('error', trans('admin::app.errors.401'));

            return redirect()->route('admin.session.create');
        }

        return $next($request);
    }

    /**
     * Check for user, if they have empty permissions or not except admin.
     *
     * @return bool
     */
    public function isPermissionsEmpty()
    {
        if (! $role = auth()->guard('user')->user()->role) {
            abort(401, 'This action is unauthorized.');
        }

        if ($role->permission_type === 'all') {
            return false;
        }

        if ($role->permission_type !== 'all' && empty($role->permissions)) {
            return true;
        }

        $this->checkIfAuthorized();

        return false;
    }

    /**
     * Check authorization.
     *

View on GitHub (pinned to 13d6988cda)

When it happens

Trigger: Thrown at packages/Webkul/Admin/src/Http/Middleware/Bouncer.php:58 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of krayin/laravel-crm@13d6988cda (2026-08-17). Data as JSON: /api/errors/43f1eded4a3e0ed2. Report an issue: GitHub.