use of io.jmix.ui.accesscontext.UiMenuContext in project jmix by jmix-framework.
the class SideMenuBuilder method build.
protected void build(SideMenu menu, List<MenuItem> rootItems) {
Window window = ComponentsHelper.getWindowImplementation(menu);
if (window == null) {
throw new IllegalStateException("SideMenu is not belong to Window");
}
for (MenuItem menuItem : rootItems) {
// AppMenu does not support separators
UiMenuContext menuItemContext = new UiMenuContext(menuItem);
accessManager.applyRegisteredConstraints(menuItemContext);
if (menuItemContext.isPermitted() && !menuItem.isSeparator()) {
createMenuBarItem(window, menu, menuItem);
}
}
removeExtraSeparators(menu);
}
use of io.jmix.ui.accesscontext.UiMenuContext in project jmix by jmix-framework.
the class MenuBuilder method isPermitted.
protected boolean isPermitted(MenuItem item) {
if (Strings.isNullOrEmpty(item.getId()) || item.isSeparator()) {
return true;
}
UiMenuContext menuItemContext = new UiMenuContext(item);
accessManager.applyRegisteredConstraints(menuItemContext);
return menuItemContext.isPermitted();
}
use of io.jmix.ui.accesscontext.UiMenuContext in project jmix by jmix-framework.
the class SideMenuBuilder method isPermitted.
protected boolean isPermitted(MenuItem item) {
if (Strings.isNullOrEmpty(item.getId()) || item.isSeparator()) {
return true;
}
UiMenuContext menuItemContext = new UiMenuContext(item);
accessManager.applyRegisteredConstraints(menuItemContext);
return menuItemContext.isPermitted();
}
Aggregations