src/Services/HCMenuService.php
private function getAccessibleMenuItems(HCUser $user, array $menus): array
    {
        foreach ($menus as $key => $menu) {
            if (!array_key_exists('aclPermission', $menu) || $user->cannot($menu['aclPermission'])) {
                unset($menus[$key]);
            }
        }

        return array_values($menus);
    }
private function getAccessibleMenuItems(HCUser $user, array $menus): array
    {
        foreach ($menus as $key => $menu) {
            if (!array_key_exists('aclPermission', $menu) || $user->cannot($menu['aclPermission'])) {
                unset($menus[$key]);
            }
        }

        return array_values($menus);
    }
private function getAccessibleMenuItems ( HCUser $ user , array $ menus ) : array { foreach ( $ menus as $ key => $ menu ) { if ( ! array_key_exists ( 'aclPermission' , $ menu ) || $ user -> cannot ( $ menu [ 'aclPermission' ] ) ) { unset ( $ menus [ $ key ] ) ; } } return array_values ( $ menus ) ; }
Filter acl permissions

@param HCUser $user
@param array $menus
@return array
Filter acl permissions