title: Umbraco 5 ask if user has permission to node
body: <p>Im working with Umbraco 5.1 beta. On the internet  (this information is from previous versions, could not find recent documentation on it) I find that I could ask a node if the user has Access. In that way I want to build up my menu. The thing is, I cant get it to work, the HasAccess and IsProtected properties are not working. What am I doing wrong? Or does it work different in the newer versions of Umbraco? (I also tried it as method, still no result)</p>
  
  <p>This is the code I'm now using:</p>
  
  <pre><code>@inherits RenderViewPage
  @using Umbraco.Cms.Web;
  
   @{
       var Homepage = @DynamicModel;
       while (Homepage.ContentType.Alias != "homePage")
       {
           Homepage = Homepage.Parent;
       }
   }
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="@Homepage.Url"&gt;Home&lt;/a&gt;&lt;/li&gt;
    @foreach (var item in Homepage.Children) {
        if(!item.IsProtected || (item.IsProtected &amp;&amp; item.HasAccess)) {
            if(@item.CurrentTemplate != null) {
                var childName = item.Name ?? "(No name yet)";
                &lt;li&gt;&lt;a href="@item.Url"&gt;@childName &lt;/a&gt;&lt;/li&gt;
            }
        }
    }
    &lt;/ul&gt;
  </code></pre>