Show certain content blocks only to logged in users

Is there a straightforward way to show certain content blocks in a page (marked by a CSS class, or template) only to logged in users?

The filtering must take place on server side, though. A pure CSS solution where you set a "loggedin" class to the body, and then build a "body.loggedin .contentblock { display: block }" rule isn't sufficient, as I want to maintain editing notes in those blocks that shouldn't be in the public pages' source code at all.

View Replies: View Best Answer
enlil replied on at Permalink Reply
Mainio replied on at Permalink Best Answer Reply
Should be possible through advanced permissions.

If you want to add a whole area that is only visible to logged in users, that should also be possible through advanced permissions.

If advanced permissions seem like an overkill for the problem, it's also possible with a tiny bit of code:
<?php global $u; if ($u->isLoggedIn()) {
  $a = new Area("Logged In");
} ?>
pekka replied on at Permalink Reply
Ahh, I was being thick! I was trying to find a way to protect individual *blocks* while of course you can just create a separate area (which makes the most sense anyway). Thanks!