I am facing issue with Custom Security Constraints in Jmix Application

Hello everyone,

I m developing a Jmix application and I have run into an issue with custom security constraints. I use PostgreSQL as my database & Jmix version 1.5.4. I have implemented role based access control but I am having trouble applying more granular, custom constraints based on specific user attributes; I want restrict certain parts of the UI and data access based on user defined fields beyond their role, such as department or access level.

I am installing the application on google cloud platform & everything is working smoothly except for these specific security constraints. Also I have tried creating custom security policies & overriding the user access checker class but it does not seem to fully apply as expected. Some users are still able to access parts of the application they should not be able to. I have also looked into defining constraints at the entity level but it is still not working as intended.

Has anyone faced a similar issue or have any advice on the best approach to implement these kinds of constraints in Jmix?

Thank you…:slight_smile:

Hello,
how about using the init event of your view, and there you programmatically create the needed buttons if the current or substituted user has rights?
As for data access, maybe use a loader delegate to fetch only the current or substituted user’s data.

Kind regards,
Mladen