Row level policy for entity attribute

We have an entity with some data that may be hidden for some users.

Let’s say we have birthday of our Users and some privacy settings.

If privacy is set to all, anybody should be able to see birthday. If it’s set to team, only users in the same team should see birthday.
The problem is that row level policies only work on entity level. So we cannot hide a single property with this.

I thought about using a child class UserWithDetails extends User that contains the additional data but I don’t know how to show parent and child entities in the same table with different level of details.

I think it would be possible to do it with an additional entity UserDetails with a composition relation to User.

Would you recommend this solution?

1 Like

Hi,
Jmix security doesn’t have out-of-the-box solution for your task.
You can just implement the logic in the corresponding screens where the data should be hidden depending on the user’s role and other entity attributes.