Permission check updated to handle groups viewable by anyone