# fluent-cart/1.6.4/app/Http/Controllers/Controller.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 40 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Controllers/Controller.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Http/Controllers/Controller.php
- Modified: 2025-10-14T16:36:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Controllers/Controller.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Http\Controllers;

use FluentCart\App\Helpers\Helper;
use FluentCart\App\Models\User;
use FluentCart\App\Services\RoleManager;
use FluentCart\Framework\Http\Controller as BaseController;

abstract class Controller extends BaseController
{
    /**
     *
     * @param string $permission
     * @return false|string|void
     */
    public function redirectOnUnauthorized(string $permission)
    {
        return true;
    }

    public function getUser()
    {
        return Helper::getCurrentUser();
    }

    public function entityNotFoundError($message, $buttonText = null, $route = '/'): \WP_REST_Response
    {
        return $this->sendError([
            'data' => [
                'message'    => $message,
                'buttonText' => $buttonText ?? __('Back to Dashboard', 'fluent-cart'),
                'route'      => $route,
            ],
            'code' => 'fluent_cart_entity_not_found',
        ], 404);
    }

}

```
