title: How to implement row-level security in Java?
body: <p>I am currently evaluating authentication / authorization frameworks.</p>
  
  <p>Apache Shiro seems to be very nice but I am <strong>missing row-level security</strong> features.</p>
  
  <p>E.g. there might be special rows in a database which should only visible and accessible by users with special privileges.
  To avoid unnecessary round-trips, we currently modify the SQL queries to join with our authorization data to get only the visible rows for the current user.</p>
  
  <p>But this concepts doesn't feel 'right' to me, because we <strong>mix business code with security related code</strong> which should be orthogonal and independent from each other.</p>
  
  <ul>
  <li><strong>What solutions are available/possible?</strong></li>
  <li><strong>How do you implement row-level security</strong> (especially in combination with jpa)<strong>?</strong></li>
  </ul>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Target database is mostly Oracle 10g/11g <br>
  - but a database independent solution would be preferred if there are no big drawbacks</p>