Filter the data according to the client

good morning everyone

using the example of PetClinic, I would like to provide access to the end customer, so that he can register PETs, schedule an appointment, schedule another service.

thinking in this way, I need to filter the data that will be displayed, such as PETs only linked to his registration, among others

what would be the best way for the customer to have access to the system and be able to register their pets.

and when scheduling, there would be data that the customer should not see, but he needs to know that the specific time is reserved.

Could you help me by pointing out some examples?

Hi,
What you need is Access Groups with Predicate or JPQL constraints.
A User entity will be somehow linked with Pet in your data model, and then Constraints will filter Pets and Visits that correspond only to the current user.

See info here: Access Groups - CUBA Platform. Developer’s Manual

Video tutorial: CUBA platform — Access Groups - YouTube

By default, all components in UI and DataManager calls from UI will apply these constraints. However, when necessary (when scheduling), access checks can be turned off for particular data read operation, see info here: Data Access Checks - CUBA Platform. Developer’s Manual

1 Like

Hello,

I was away for a few days, so I didn’t return before, yesterday I saw your return and analyzed your return, I was simply incredulous.

today I set up an application for testing with cuba and jmix.

the result is simply magical, easy to understand and apply

thank you so much