protected function filterList($list, $perm)
    {
        $ret = $list->filterByCallback(function ($item) use ($perm) {
            if ($item->hasExtension('Restrictable')) {
                return $item->checkPerm($perm);
            }
            return $item->canView();
        });
        return $ret;
    }