title: How to handle role-based views in MVC?
body: <p>Regardless of the language or MVC framework used, how should I handle different views based on roles?</p>
  <p>For example (pseudo code):</p>
  <h3>views/post/show:</h3>
  <pre><code>&lt;% show post here %&gt;
  if (role.isAdmin or role.isModerator) {
     &lt;% show moderation tools %&gt;
  }
  &lt;% show rest of content %&gt;
  </code></pre>
  <p>I don't quite like the idea of putting too much business logic into the view, but it doesn't seem like there're other options. Are there?</p>
  <p>This gets messier and messier once you have more roles, or different levels of permissions. Take this site for example. Users with more than 200 rep see less ads. Users with more than 500 rep have a retag button. Then you get an edit button at 2000, a close button at 3000, moderation tools at 10k, and more functions if you are a &quot;star&quot; moderator.</p>