problem description
recently, I am working on permission design, and one of the more troublesome problems for me is how to do data field permissions. For example, the system has two roles: ROLE_ADMIN and ROLE_GUEST, when querying the list of goods, ROLE_ADMIN can see the price (price field), ROLE_GUEST can not, need to be represented by -. The system is a micro-service architecture, and field permissions can only be done at the gateway layer (if you do it in a micro-service, it is likely to appear: call link A-> B-> C-> DMagi B if a field is masked and A happens to use this field for calculation).
the environmental background of the problems and what methods you have tried
I want to write the URL and the field to be verified into the database, check out the verification field based on the user query role at the gateway, and then replace the corresponding value in the return value (json). But the performance will be very poor.
related codes
not available for the time being
what result do you expect? What is the error message actually seen?
what can I do to improve performance?