vyuldashev / nova-permission

A Laravel Nova tool for Spatie's laravel-permission library
https://novapackages.com/packages/vyuldashev/nova-permission
419 stars 217 forks source link

403 error #190

Open exshapoval opened 1 year ago

exshapoval commented 1 year ago

Hi I use your module

I use Laravel 10.1.5 and Nova 4.22.1 When in .env APP_ENV=local all ok But when APP_ENV=production I see error 403 on my admin/login page

How I can fix it for production?

dualklip commented 8 months ago

Your issue is not related with this package. Perhaps you are not configured properly your Nova Gate in https://github.com/vyuldashev/nova-permission/issues/190

This could be an example about how to do it:

/**
     * Register the Nova gate.
     *
     * This gate determines who can access Nova in non-local environments.
     *
     * @return void
     */
    protected function gate(): void
    {
        Gate::define('viewNova', function ($user) {
            return $user->hasRole('Super Admin') || $user->hasRole('Admin');
        });
    }