Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Can't log in when "Read Admin Panel" permission dissabled

Patrick Willy   ( User )

Commented 5 years ago

If you create a user and allocate them different roles under the roles page, and dissable "Read Admin Panel", you get an error message while logging in. The error message will be about redirection.

Denis Dulici   ( Admin )

Commented 5 years ago

Hello Patrick,


Yes, that permission is required to access admin panel.


Regards

Patrick Willy   ( User )

Commented 5 years ago

Hi Denis,


I understand that this permission is required to access the admin panel. What if I do not want the user to access admin panel? When I dissable this permission, the app gets stuck while loggind in. 


I will create two account for you to try this.


 


 


EDIT: removed credentials!


 


The only difference between those two users is that one has the "Read Admin Panel" permission enabled while the other does not. The absense of this permission is causing the system to hung at log in.

Nasser Hassan   ( User )

Commented 5 years ago

Hi,I find a solution that helps you.  First, you need to create permission read-dashboard and choose for what roles you need, I put only for admin and manager. 


Second, you need to change the code in App\Http\Middleware\AdminMenu.php in public function handle this code 


 $menu->add([


 'url' => '/',


  'title' => trans('general.dashboard'),


  'icon' => 'fa fa-dashboard',


   'order' => 1,


    ]);


with


if($user->can('read-dashboard')) {


            $menu->add([


                'url' => '/',


                'title' => trans('general.dashboard'),


                'icon' => 'fa fa-dashboard',


                'order' => 1,


            ]);


        }. 


This code will not show the link Dashboard in the right navigation.


Third, if you want the dashboard the show for other roles what you created need in resource/view/common/dashboard - index.blade.php add an if statement like this :


@if($auth_user->can('read-dashboard'))


code for default dashboard


@else 


your code


@endphp


Hope will help you))))

Ali Yılmaz   ( User )

Commented 5 years ago

Denis hocam, aynı sorunu bende yaşadım, eğer admin paneli kutusu işaretli değilse bu göreve tanımlı kullanıcı girişi yaparken sistem takılıyor, takılma durumundan çıkmak için çerez ve sessionları temizlemek de işe yaramıyor.

Please login or register to leave a response.

Showing 1 to 5 of 5 discussions