use of com.axelor.ui.QuickMenu in project open-platform-demo by axelor.
the class AccessSaleQuickMenu method create.
@Override
public QuickMenu create() {
QuickMenu menu = super.create();
User user = AuthUtils.getUser();
if (user == null || !Beans.get(JpaSecurity.class).isPermitted(JpaSecurity.CAN_READ, Order.class)) {
return menu;
}
if (menu == null) {
// can be null in case use doesn't have permission on Contact domain.
menu = createAccessQuickMenu();
}
menu.setItems(Stream.of(menu.getItems(), List.of(new QuickMenuItem(I18n.get("Quotations"), "sale.orders.draft"), new QuickMenuItem(I18n.get("Sale Orders"), "sale.orders"))).flatMap(Collection::stream).collect(Collectors.toList()));
return menu;
}
use of com.axelor.ui.QuickMenu in project open-platform-demo by axelor.
the class AccessContactQuickMenu method create.
@Override
public QuickMenu create() {
User user = AuthUtils.getUser();
if (user == null || !Beans.get(JpaSecurity.class).isPermitted(JpaSecurity.CAN_READ, Contact.class)) {
return null;
}
QuickMenu menu = createAccessQuickMenu();
menu.getItems().add(new QuickMenuItem(I18n.get("Contacts"), "contact.all"));
return menu;
}
Aggregations