anchor.diff:  @PreAuthorize("#n == authentication.name")
   Contact findContactByName(@Param("n") String name);
   ----
  +
  +.Kotlin
  +[source,kotlin,role="secondary"]
  +----
  +import org.springframework.data.repository.query.Param
  +
  +...
  +
  +@PreAuthorize("#n == authentication.name")
  +fun findContactByName(@Param("n") name: String?): Contact?
  +----
  +====
   
   +
   
  
positive.code: 
  Instead of repeating this everywhere, we can create a meta annotation that can be used instead.
  
  [source,java]
  ----
  @Retention(RetentionPolicy.RUNTIME)
  @PreAuthorize("#contact.name == authentication.name")
  public @interface ContactPermission {}
  ----
  
  Meta annotations can be used for any of the Spring Security method security annotations.
  In order to remain compliant with the specification JSR-250 annotations do not support meta annotations.
  
  
negative.code: @PreAuthorize("#c.name == authentication.name")
  public void doSomething(@P("c") Contact contact);
  ----
  
  .Kotlin
  [source,kotlin,role="secondary"]
  ----
  import org.springframework.security.access.method.P
  
  ...
  
  @PreAuthorize("#c.name == authentication.name")
  fun doSomething(@P("c") contact: Contact?)
  ----
  ====
  
  +
  
  