title resources is showing even though the user does not have any of the appropriate permissions set for the resource menu items.
This can be fixed with a simple if statement in the "vendor\orchid\crud\src\Arbitrator.php" @ "registerMenu"
`private function registerMenu(Resource $resource, int $key): Arbitrator
{
if (! $resource::displayInNavigation()) {
return $this;
}
View::composer('platform::dashboard', function () use ($resource, $key) {
if (user()->hasAnyAccess('manage-crud-resource-*')) {
$title = Menu::make()
->canSee($key === 0)
->title(__('Resources'))
->sort($resource::sort());
Dashboard::registerMenuElement(\Orchid\Platform\Dashboard::MENU_MAIN, $title);
}
$menu = Menu::make($resource::label())
->icon($resource::icon())
->route('platform.resource.list', [$resource::uriKey()])
->active($this->activeMenu($resource))
->permission($resource::permission())
->sort($resource::sort());
Dashboard::registerMenuElement(\Orchid\Platform\Dashboard::MENU_MAIN, $menu);
});
return $this;
}`
title resources is showing even though the user does not have any of the appropriate permissions set for the resource menu items.
This can be fixed with a simple if statement in the "vendor\orchid\crud\src\Arbitrator.php" @ "registerMenu"
`private function registerMenu(Resource $resource, int $key): Arbitrator
{
if (! $resource::displayInNavigation()) {
return $this;
}