Generating page content specific to user's role

I needed recently to generate different content on the same page for different kind of users. I have failed to do this on top of current `connected_page` function (page header for logged inproblem was as like as guest's one, no idea what was wrong), so I have added another one. It studies user's kind and do  one of four decisions:

1. Logged in user when only specific group has access to this page. Moderator, for example.
2. Logged in user without allowed group. Normal user
3. Guest when all logged in users can see this page
4. Guest when only specific groups can see content. It seems that it's good choice for  `Permission_denied` page there.

Do you need this function?