I have used following code to check if a user has "Read" Permission Levels on Root Web of a site
if (site.RootWeb.DoesUserHavePermissions(SPBasePermissions.ViewPages))
{
render root web url;
}
else
{
render public url
}
but it renders root web url för current user without having permissions att all. and when he clicks on the url he gets access denied .... error message.