title: How Can I Hide Specific Elements on a Razor View Based on Security without Logic in View?
body: <p>I have looked all over for elegant solutions to this not so age-old question.  How can I lock down form elements within an ASP.Net MVC View, without adding if...then logic all over the place?<br>
  Ideally the BaseController, either from OnAuthorization, or OnResultExecultion, would check the rendering form elements and hide/not render them based on role and scope.<br>
  Another approach I have considered is writing some sort of custom attributes, so as to stay consistent with how how we lock down ActionResults with [Authorize].  Is this even possible without passing a list of hidden objects to the view and putting if's all over?</p>
  
  <p>Other background info: We will have a database that will tell us at execution time (based on user role/scope) what elements will be hidden.  We are using MVC3 with Razor Viewengine.  We're utilizing a BaseController where any of the Controller methods can be overridden.</p>
  
  <p>Any help on this would be deeply appreciated!</p>