0

I have two projection

@Projection(name = "default",types = { People.class }) 
public interface DefaultPeople {
    String getFirstName();
    String getLastName();
}

and

@Projection(name = "privacy",types = { People.class }) 
public interface DefaultPeople {
    @Value("#{target.firstName.charAt(0)}")
    String getFirstName();
    @Value("#{target.lastName.charAt(0)}")
    String getLastName();
}

privacy projection print only first charater of firstname and lastname

i want : ROLE_ADMIN access to projection default and ROLE_USER access to only projection pryvacy

is possible?

1 Answers1

0

Impossible. You need to implement the Controller to return different projection yourself.

Spring Data REST is not a silver bullet to solve all HTTP API problem. Just don't use it if it doesn't meet your requirement.

yejianfengblue
  • 2,089
  • 1
  • 14
  • 18