Is it possible to bypass row-level role?

Hello,
is it possible to bypass defined row-level role? Let’s say that I have set row-level role that user can’t see inactive products. But in one browse screen I want to show those inactive products to user.
Shoud I remove row-level role completely (and set queries on each individual browse screen), or is there any other solution?

Thank you!

Hi Michal,

UnconstrainedDataManager allows you to bypass security, see Authorization :: Jmix Documentation.

So you can create a load delegate in your browse screen and use UnconstrainedDataManager to load data instead of the standard DataManager:

@Autowired
private UnconstrainedDataManager unconstrainedDataManager;

@Install(to = "departmentsDl", target = Target.DATA_LOADER)
private List<Department> departmentsDlLoadDelegate(LoadContext<Department> loadContext) {
    return unconstrainedDataManager.loadList(loadContext);
}

Use “Generate Handler” action in Studio to create a delegate stub.

Hi Konstantin,
thank you, it works flawlessly!