title: Complex solution for maintaining role-based security
body: <p>In my future web application there would be many user roles. Depending on user's role, webapp should restrict users's access to certain pieces of information. I need to implement following features:</p>
  
  <ul>
  <li>depending on role, user should see only columns and rows (in data grid) that are available for current role and user</li>
  <li>depending on role, user should view page in readonly or in editable mode</li>
  <li>depending on role, user should have visible/hidden some controls on a web page</li>
  </ul>
  
  <p>In my previous applications (that were pretty simple) such problem was solved using many conditionals operators in codebehind files and in markup files also. It was quite difficult to maintain such code. </p>
  
  <p>I'm wondering are there any complex solution for maintaining role-based security for all levels of apllication (data, logic, view) without messing up code with IFs.</p>
  
  <p>ps both, solutions for java and .net platforms are interesting</p>