title: Spring Security @PreAuthorize - Restrict certain roles by using Spring EL
body: <p>Using Spring Security 3.1.3.RELEASE</p>
  
  <p>So if there are a list of roles (over 10) and there is a need to block just ONE from accessing a Spring Controller method. Can this be done using Spring Expression Language, and avoid listing each and very accepted role?</p>
  
  <p>For example, by including the Not sign.</p>
  
  <blockquote>
    <p>@PreAuthorize("!hasRole('ROLE_FREE_USER')")</p>
  </blockquote>
  
  <p>over listing all the roles like this</p>
  
  <blockquote>
    <p>@PreAuthorize("hasAnyRole('ROLE_ADMIN','ROLE_PAID_USER','ROLE_PREM_USER',...)</p>
  </blockquote>
  
  <p>I've looked at the documentation over here: <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/el-access.html" rel="nofollow">http://static.springsource.org/spring-security/site/docs/3.0.x/reference/el-access.html</a></p>
  
  <p>But there seems to be nothing on the NOT EQUAL to cases. Anyone face similar issue?</p>