We recently migrated our project from JMix 1.4.2 to 2.4.2 and have completed the migration process.
However, we are encountering the following error every time: Denied access to [view: MainViewTopMenu] for user [anonymous] by io.jmix.securityflowui.constraint.UiShowViewConstraint
Context:
- Our project requires having menus at the top of the application.
- We have used
MainViewTopMenu
for this purpose. - To allow access, I updated the UiMinimalRole as follows:
@ResourceRole(name = "UI: minimal access", code = UiMinimalRole.CODE, scope = SecurityScope.UI)
public interface UiMinimalRole extends UiMinimalPolicies {
String CODE = "ui-minimal";
@ViewPolicy(viewIds = "MainViewTopMenu")
void main();
@ViewPolicy(viewIds = "LoginView")
@SpecificPolicy(resources = "ui.loginToUi")
void login();
@EntityPolicy(entityClass = KeyValueEntity.class, actions = EntityPolicyAction.READ)
@EntityAttributePolicy(entityClass = KeyValueEntity.class, attributes = "*", action = EntityAttributePolicyAction.VIEW)
void keyValueEntity();
}