Is your feature request related to a problem? Please describe.
I need to hide menu item for some users role
Describe the solution you'd like
very basic solution I've found is to add canView method in EmailResource
es:
public static function canViewAny(): bool
{
return auth()->user()->{Config::get('filament-email.resource.canViewMethod')}();
}
And in config add the name of the method
'resource' => [
...
'canViewMethod' => 'isAdmin'
],
in User model
public function isAdmin(): bool
{
return $this->hasRole('Administrator');
}
Thanks
Cosimo
Is your feature request related to a problem? Please describe. I need to hide menu item for some users role
Describe the solution you'd like very basic solution I've found is to add canView method in EmailResource es: public static function canViewAny(): bool { return auth()->user()->{Config::get('filament-email.resource.canViewMethod')}(); } And in config add the name of the method 'resource' => [ ... 'canViewMethod' => 'isAdmin' ], in User model public function isAdmin(): bool { return $this->hasRole('Administrator'); } Thanks Cosimo