title: Spring two repositories of same entity
body: <p>I've multiple different type users in my application, each type has it own role (and obviously authorities)</p>
  
  <p>I want to use spring data rest but this functionnality must be possible for the ADMIN_ROLE user only.</p>
  
  <p>I've then created 2 Repositories for each entity, one for the admin and the other for the rest of the users:</p>
  
  <pre><code>@RepositoryRestResource(exported = false)
  public interface MenuRepository extends JpaRepository&lt;Menu, Integer&gt; {
  
  }
  
  // -------------------------------------------------------------------
  
  @RepositoryRestResource
  @PreAuthorize("hasRole('ROLE_ADMIN')")
  public @interface AdminRestRepository {
  }
  
  // -------------------------------------------------------------------
  
  @AdminRestRepository
  public interface AdminMenuRestRepository extends JpaRepository&lt;Menu, Integer&gt; {
  }
  </code></pre>
  
  <p>The problem is that once i start the application, sometimes the repository is exported and some other time it's not... any clue ?</p>