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;
    }
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;
    }
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 ; }
Filter the given list to return the accessible objects

@param type $list
Filter the given list to return the accessible objects