krayin/laravel-crm · error

admin::app.errors.unauthorized

admin::app.errors.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/Controllers/Controller.php:40

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

    /**
     * Prevent access to a record that is not owned by (or shared with) the current user.
     *
     * @param  int|array|null  $ownerIds  The user id (or ids, e.g. owner + participants) tied to the record.
     * @return void
     */
    protected function preventUnauthorizedAccess($ownerIds)
    {
        $userIds = bouncer()->getAuthorizedUserIds();

        if ($userIds === null) {
            return;
        }

        if (empty(array_intersect((array) $ownerIds, $userIds))) {
            abort(401, trans('admin::app.errors.unauthorized'));
        }
    }

    /**
     * Filter a collection of records down to the ones the current user is authorized to manage.
     *
     * @param  Collection  $records
     * @param  callable|null  $ownerIdsResolver  Resolves the owning user id(s) for a record; defaults to `user_id`.
     * @return Collection
     */
    protected function filterAuthorizedRecords($records, ?callable $ownerIdsResolver = null)
    {
        $userIds = bouncer()->getAuthorizedUserIds();

        if ($userIds === null) {
            return $records;
        }

View on GitHub (pinned to 13d6988cda)

When it happens

Trigger: Thrown at packages/Webkul/Admin/src/Http/Controllers/Controller.php:40 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/6966fc1227a45c21. Report an issue: GitHub.