title: ASP.MVC Permissioning : Is there a way to control partial content ?
body: <p>I am writing an ASP.MVC application and I know you can use authorisation filters on the cotrollers to control access to the pages but I am wondering what is the best approach to do if you want to control access to protected data within partial views. </p>
  
  <p>From what I have read ASP.MVC doesnt offer this level of granularity.</p>
  
  <p>This seems easily enough by adding the user permissions to the model as an attribute and then using a simple factory to decide if the view should be rendered or a blank view be returned. </p>
  
  <p>So far I have </p>
  
  <p>RenderPartial(PartialFactory.IsAllowedToRender("partialName", Model.Security), Model) </p>
  
  <p>and the Factory either returns the view requested or a blank partial view. </p>
  
  <p>Has anyone tried this before or knows why no one does this (apart from the extra effort) </p>