title: How to provide Field Level security in an application using ExtJS for front and Spring for backend?
body: <p>I have an application which uses Spring for backend and ExtJs for UI.</p>
  
  <p>In this application, users can have variours roles and access rights.</p>
  
  <p>When a user logs in and opens a form, then depending upon her role, its decided that which fields will be displayed to her.</p>
  
  <p>For handling this, we have done following two things:</p>
  
  <p><em>1. Enclosed the JS code (code which needs to be filtered on basis of role) in spring security tags following way:</em></p>
  
  <pre><code>&lt; tag start &gt;
  
  js code
  
  &lt; / tag end &gt;
  </code></pre>
  
  <p><em>2. Saved all js files as jsp, for example, instead of having a file as test.js - we changed it to test.js.jsp. This forces the backend to parse the security tags before delivering the code to client side.</em></p>
  
  <p>Though this works fine, but there are following issues which we are ambigous about:</p>
  
  <p><strong>a. Is this the best way of implementing such thing? What other way could this be acheived?</strong></p>
  
  <p><strong>b. After converting js to jsp, the compression tools for JS are not able to minify it due to presence of spring security tags. Could something be done about it?</strong></p>
  
  <p>Looking forward to guidance at above.</p>
  
  <p>Thanks in advance.</p>