title: Render JSF component based on user role
body: <p>How do I render JSF components based on a logged in user's role? I know the external context exposes the principals, but how should I do the rendering properly in JSF? In JSP it would be something like</p>
  
  <pre><code>&lt;% isUserInRole(Roles.ADMIN) { %&gt;
  &lt;button&gt;Edit!&lt;/button&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <p>How do I write this in JSF the best possible way? My best guess is the rendered attribute tied to a backing bean's method that returns a boolean, but that would introduce an irrelevant backing bean if I have to render some navigation items only for admins...</p>
  
  <p>Glassfish V3.1, JSF 2.x</p>