<commit_before><?php namespace monad\admin ?>
<nav id="main"><ul class="menu">
<?php

foreach ($menu->items() as $package => $group) {
    $classes = explode(' ', $package);
    foreach ($classes as &$class) {
        $class = "menu-$class";
    }

?>
    <li class="<?=implode(' ', $classes)?>">
        <h2><?=$group->title()?></h2>
        <ul class="submenu">
<?php

    foreach ($group->items() as $uri => $txt) {
        $parts = explode('/', $uri);
        $class = '';
        while (!strlen($class) && $parts) {
            $class = array_pop($parts);
        }

?>
            <li class="menu-<?=$class?>"><a href="<?=$uri?>"><?=$txt?></a></li>
            
<?php   } ?>
        </ul>
    </li><commit_msg>check permissions<commit_after><?php namespace monad\admin ?>
<nav id="main"><ul class="menu">
<?php

foreach ($menu->items() as $package => $group) {
    if (!$group->hasPermission()) {
        continue;
    }
    $classes = explode(' ', $package);
    foreach ($classes as &$class) {
        $class = "menu-$class";
    }

?>
    <li class="<?=implode(' ', $classes)?>">
        <h2><?=$group->title()?></h2>
        <ul class="submenu">
<?php

    foreach ($group->items() as $item) {
        if (!$item->hasPermission()) {
            continue;
        }
        $uri = $item->url();
        $parts = explode('/', $uri);
        $class = '';
        while (!strlen($class) && $parts) {
            $class = array_pop($parts);
        }

?>
            <li class="menu-<?=$class?>"><a href="<?=$uri?>"><?=$item?></a></li>
            
<?php   } ?>
        </ul>
    </li>
{'fraction_non_alphanumeric': 0.2522012578616352, 'fraction_numerical': 0.0025157232704402514, 'mean_word_length': 2.233739837398374, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '796371', 'n_tokens_mistral': 518, 'n_tokens_neox': 527, 'n_words': 103}