Jmix Role Access Denied Error

I’m working with JMix roles. When I don’t grant access to the detail view for a list view that has a “Create” button (which redirects to the detail view), the application is redirected to a different page and displays the following error message:

"Could not navigate to ‘sampleScreen/new’. Reason: Access denied.

Available routes: … … …"

Instead of this, I want a popup to appear when the “Create” button is clicked.

Hi,

The default mechanism works such that if an unhandled exception occurs during navigation, Vaadin displays a special error view.

Jmix simply adds io.jmix.securityflowui.access.JmixNavigationAccessChecker that check if a view permitted using our UiAccessChecker.

To display a notification instead of redirecting to an error page, it would require completely overriding the Vaadin com.vaadin.flow.server.auth.NavigationAccessControl mechanism, which is complex.

Since the default error page hide details, such as the reason why we cannot navigate, I’d recommend overriding this error page. In our documentation we have an example how to override RouteNotFoundError page. Same is applicable for the RouteNotFoundError page.

Regards,
Gleb