title: On an asp.net-mvc site, Is there a good pattern for dealing with both editable and read only views?
body: <p>I have an asp.net-mvc website where up until now there have been no entitlements as its been open to everyone.  Many of the pages are detailed forms with textboxes, select dropdowns, etc</p>
  
  <p>I now need to change this to make many of the existing pages "entitled" so only certain people have edit capability and everyone else sees a read only page.  I am trying to figure out if I should</p>
  
  <ol>
  <li><p>Create a seperate view for everyone one of my existing views with forms that is just read only html on a page and redirect based on entitlements on the server side, something like</p>
  
  <pre><code>public ActionResult OrderView()
  {
       var isEntitled = Model.IsEntitled()
       if (isEntitled)
       { 
            return("OrderEditableView", GetViewModel()); 
       }
       else 
       {
           return("OrderReadOnlyView", GetViewModel());  
       }
  </code></pre>
  
  <p>}</p></li>
  </ol>
  
  <p>or</p>
  
  <ol>
  <li>Reuse the same view and simply disable or hide the "Save" button on the screen.  </li>
  </ol>
  
  <p>on my view have</p>
  
  <pre><code>     &lt;% if (Model.IsEntitled) { %&gt;
             &lt;button id="saveButton"&gt;Save Changes&lt;/button&gt;
       &lt;% } %&gt;
  </code></pre>
  
  <p>The second option would be much quicker to implement but would be a little weird because it would look like you could edit all of the fields but just dont' see (or see a disabled) Save button on the form.</p>
  
  <p>The first option seems cleaner but I would have to go and create a new view for everyone of my screens and that seems like a lot of work (over 100 views currently)</p>
  
  <p>This seems like a common situation so I wanted to see if there was a best practice on dealing with this situation.  Obviously I am looking for a solution given the current situation that I am in but I would also be interested if there were patterns or solution that would be considered best practice or recommended if I was starting from scratch.</p>