title: Spring Security @PreAuthorization pass enums in directly
body: <p>My question is a duplicate of <a href="https://stackoverflow.com/questions/18097152/custom-annotation-with-spring-security">Custom annotation with spring security</a> but it went unanswered and I believe there should be a simple solution to the problem.</p>
  
  <p>Basically instead of doing:</p>
  
  <pre><code>@PreAuthorize("hasPermission(T(fully.qualified.Someclass).WHATEVER, T(fully.qualified.Permission).READ")
  </code></pre>
  
  <p>I would like to do:</p>
  
  <pre><code>@PreAuthorize(Someclass.WHATEVER, Permission.READ)
  </code></pre>
  
  <p>or possibly some custom annotation that will wire up easily with spring security</p>
  
  <p>This seems much cleaner to me and I would like to be able to do it if I can.</p>