Did you test the gate in a production environment? If I remember correctly, Nova allows all in local dev environment and uses the gate in a production one.
May 31, 2019
8
Level 3
Laravel nova access restriction vie Gate does not work
I tried to restrict access to Nova depending on user role. Although It seems like I did everything according to the documentation, Nova seems to ignore it.
protected function gate()
{
Gate::define('viewNova', function ($user) {
return in_array($user->role_id, [
'1'
]);
});
}
Please or to participate in this conversation.