Re: Code: is customer member of discount group - restricting view based on membership
A lot of what you want to achieve can in fact be done within the template override system - except for the products_all and products_new listings. For those two listings, you'll need to modify the sql queries in the relevant includes/modules/pages/products_(new-all)/header_php.php files.
Rather than modify the category_tree class and have to worry about upgrades, why not duplicate the class file, rename it my_category_tree and rename/modify the two functions within it. (you're going to have to modify it anyway, so with only a little more work you can save a lot of hassle for upgrades in the future - don't forget to pay attention to the cross-references between the two functions).
Having done that, you simply make an override copy of includes/modules/sideboxes/categories.php to call your new category tree class rather than the regular one.
Neville
An assumption is what you arrive at when you get tired of thinking...