Menu / Submenu Access User level

Hi,

Can we restrict menu and sub-menu access at the user level since two user can have same role but only one has rights to access that particular sub menu or menu.

Hello!

Yes, Jmix doesn’t really do individual user permissions for menus out of the box. It’s all role-based.

But you have a couple options:

  1. Create separate roles:
    Just make two different roles - one with the submenu access, one without. Users can have multiple roles assigned to them through the Role assignments view Jmix. So both users keep their main role plus you add a supplementary role to whoever needs that extra menu.

  2. Programmatic menu filtering:
    You could customize the menu (own menu & its handling). Not super elegant but works.

  3. Custom user attribute + row-level role:
    Add a boolean field to the User entity like “canAccessSpecialMenu”. Then create a specific policy that checks this. Bit more work but cleaner than hardcoding usernames.

The cleanest/best approach is really #1 - just create granular roles. Jmix actually recommends creating fine-grained roles that you combine together Jmix, rather than trying to customize individual user permissions.

Best regards,
Dmitry